App class Category models Model name models CharField class Tag models

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# App 1
class Category(models.Model):
name = models.CharField(...)
class Tag(modelss.Model):
title = models.CharField(...)
class Post(models.Model):
title = models.CharField(...)
tag = models.ManyToManyField(Tag)
name = models.ForeignKey(Category)
# APP 2
# одно и тоже
class Category(models.Model):
name = models.CharField(...)
# одно и тоже
class Tag(modelss.Model):
title = models.CharField(...)
# расширяемо
class Post(models.Model):
title = models.CharField(...)
tag = models.ManyToManyField(Tag)
name = models.ForeignKey(Category)