From 73f6af95153c23a36aebee94a9502018819799a5 Mon Sep 17 00:00:00 2001 From: HanseGucker <hansegucker@gmail.com> Date: Wed, 4 Jul 2018 14:20:59 +0200 Subject: [PATCH] Unstable --- biscuit/apps/chronos/models.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/biscuit/apps/chronos/models.py b/biscuit/apps/chronos/models.py index 41465b7e..ff280ba5 100755 --- a/biscuit/apps/chronos/models.py +++ b/biscuit/apps/chronos/models.py @@ -1,5 +1,7 @@ +from django import forms from django.db import models - +import dbsettings +from untisconnect.api import get_terms # Create your models here. @@ -19,3 +21,15 @@ from django.db import models # text1 = models.CharField(max_length=200) # text2 = models.CharField(max_length=200) # room = models.ForeignKey(Room, on_delete=models.CASCADE) + +choices = [] +terms = get_terms() +for term in terms: + choices.append((term.id, term.name)) + + +class UNTISSettings(dbsettings.Group): + term = dbsettings.IntegerValue(widget=forms.Select, choices=choices) + + +untis_settings = UNTISSettings() -- GitLab