Add redir model, remove children albums
This commit is contained in:
parent
684982eca5
commit
1dbd1c1779
9 changed files with 84 additions and 23 deletions
14
gallery/models/redir.py
Normal file
14
gallery/models/redir.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from django.db import models
|
||||
|
||||
from gallery.models import Album
|
||||
|
||||
|
||||
class Redir(models.Model):
|
||||
path = models.CharField(max_length=255, db_index=True, unique=True, verbose_name="Path")
|
||||
album = models.ForeignKey(Album, on_delete=models.CASCADE, related_name='pathurl', verbose_name="Album")
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = "Redirs"
|
||||
|
||||
def __str__(self):
|
||||
return '{0} - {1}'.format(self.path, self.album.slug)
|
Loading…
Add table
Add a link
Reference in a new issue