X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/149903ae7da0968ef3b1b0dc0f329afeaa5a7007..e16f5c5d7985b8e501c6810abf5e540326e392f1:/src/references/models.py

diff --git a/src/references/models.py b/src/references/models.py
index c98647191..d4733ffcf 100644
--- a/src/references/models.py
+++ b/src/references/models.py
@@ -65,7 +65,8 @@ class Entity(models.Model):
                 result_data['thumbwidth'],
                 result_data['thumbheight']
             ]
-            image_data['responsiveUrls'] = result_data['responsiveUrls']
+            if 'responsiveUrls' in result_data:
+                image_data['responsiveUrls'] = result_data['responsiveUrls']
 
             image_data_list.append(image_data)
 
@@ -75,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',)