X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c8e72ddbdf4eb54951b01858cb42ecd35bd5af22..ddf2102eff7ea420a4ea5144c43409587fc1156e:/src/references/models.py?ds=sidebyside diff --git a/src/references/models.py b/src/references/models.py index 9246ee322..d4733ffcf 100644 --- a/src/references/models.py +++ b/src/references/models.py @@ -76,8 +76,15 @@ class Entity(models.Model): class Reference(models.Model): book = models.ForeignKey('catalogue.Book', models.CASCADE) entity = models.ForeignKey(Entity, models.CASCADE) - first_section = models.CharField(max_length=255) class Meta: unique_together = (('book', 'entity'),) + +class Occurence(models.Model): + reference = models.ForeignKey(Reference, models.CASCADE) + section = models.IntegerField() + html = models.TextField() + + class Meta: + ordering = ('section',)