Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Book(models.Model):
- title = models.CharField(max_length=200)
- class Page(ImageModel):
- book = models.ForeignKey(Book)
- image = models.ImageField(upload_to='book_photos')
- num_views = models.PositiveIntegerField(editable=False, default=0)
- class IKOptions:
- # This inner class to define the ImageKit options for the model
- spec_module = 'books.image_specs'
- cache_dir = 'book_photos'
- image_field = 'image'
- save_count_as = 'num_views'
Add Comment
Please, Sign In to add comment