kopia lustrzana https://github.com/wagtail/wagtail
refactor(images): Reference model directly in ForeignKey definitions
This also works around a Django bug: https://code.djangoproject.com/ticket/25858pull/1990/merge
rodzic
2b38263fba
commit
7f97b05f1a
|
@ -438,7 +438,7 @@ class Filter(models.Model):
|
|||
|
||||
|
||||
class AbstractRendition(models.Model):
|
||||
filter = models.ForeignKey('Filter', related_name='+')
|
||||
filter = models.ForeignKey(Filter, related_name='+')
|
||||
file = models.ImageField(upload_to='images', width_field='width', height_field='height')
|
||||
width = models.IntegerField(editable=False)
|
||||
height = models.IntegerField(editable=False)
|
||||
|
@ -485,7 +485,7 @@ class AbstractRendition(models.Model):
|
|||
|
||||
|
||||
class Rendition(AbstractRendition):
|
||||
image = models.ForeignKey('Image', related_name='renditions')
|
||||
image = models.ForeignKey(Image, related_name='renditions')
|
||||
|
||||
class Meta:
|
||||
unique_together = (
|
||||
|
|
Ładowanie…
Reference in New Issue