Adjusted template for animal properties like {'size_cm': 70, 'names': ['Alfons',...
[toast/alpenzoo.git] / animals / models.py
index b9841f954c54403310f2549cfe0cafe5f3d09030..cc4abdcce8f5ff473323bee1d92a911bbf7b818b 100644 (file)
@@ -1,10 +1,14 @@
 from django.db import models
+import jsonfield # https://github.com/bradjasper/django-jsonfield (7f87e68f)
 
-# Create your models here.
 
 class Animal(models.Model):
     name_german = models.CharField(max_length=255)
     size_cm = models.IntegerField()
     edible = models.BooleanField()
+    properties = jsonfield.JSONField(null=True)
+
+    def __str__(self):
+        return self.name_german