FEAT(T): First version of the 'session log' form

This commit is contained in:
2022-02-27 21:20:34 +00:00
parent ab03ad081a
commit 5eb113156b
12 changed files with 122 additions and 45 deletions

View File

@@ -21,7 +21,7 @@ from django.utils.decorators import method_decorator
from django.views import generic
from PyRIGS import decorators
from PyRIGS.views import OEmbedView, is_ajax, ModalURLMixin, PrintView
from PyRIGS.views import OEmbedView, is_ajax, ModalURLMixin, PrintView, get_related
from RIGS import models, forms
__author__ = 'ghost'
@@ -77,13 +77,6 @@ class EventOEmbed(OEmbedView):
url_name = 'event_embed'
def get_related(form, context): # Get some other objects to include in the form. Used when there are errors but also nice and quick.
for field, model in form.related_models.items():
value = form[field].value()
if value is not None and value != '':
context[field] = model.objects.get(pk=value)
class EventCreate(generic.CreateView):
model = models.Event
form_class = forms.EventForm