моделька

1
2
3
4
5
6
7
8
9
class Category(models.Model):
category = models.CharField(max_length = 20)
class Image(models.Model):
image_name = models.CharField(max_length = 40)
author_name = models.CharField(max_length = 40)
pub_date = models.DateTimeField('date published')
image_file = models.ImageField(upload_to='images')
category = models.ForeignKey(Category)