Adjusted template for animal properties like {'size_cm': 70, 'names': ['Alfons',...
[toast/alpenzoo.git] / animals / models.py
index 71a836239075aa6e6e4ecb700e9c42c95c022d91..cc4abdcce8f5ff473323bee1d92a911bbf7b818b 100644 (file)
@@ -1,3 +1,14 @@
 from django.db import models
+import jsonfield # https://github.com/bradjasper/django-jsonfield (7f87e68f)
+
+
+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
+
 
-# Create your models here.