Implemented API endpoints for ImageAttachments

This commit is contained in:
Jeremy Stretch
2017-04-03 14:00:15 -04:00
parent 6bbdc2bae1
commit 2c1fa628a2
6 changed files with 83 additions and 7 deletions

View File

@@ -384,7 +384,7 @@ class ImageAttachment(models.Model):
"""
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
obj = GenericForeignKey('content_type', 'object_id')
parent = GenericForeignKey('content_type', 'object_id')
image = models.ImageField(upload_to=image_upload, height_field='image_height', width_field='image_width')
image_height = models.PositiveSmallIntegerField()
image_width = models.PositiveSmallIntegerField()