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