X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c8e72ddbdf4eb54951b01858cb42ecd35bd5af22..ca8f4e8fef80cb603117ed579da8554f503698e5:/src/references/models.py 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',)