From d90306a5e05c76e6c5b6c959a4fef228078dd4e4 Mon Sep 17 00:00:00 2001 From: Tom Price Date: Wed, 3 Dec 2014 12:13:13 +0000 Subject: [PATCH] Added event items to the event form. Need to get this working, thinking probably best to serialize the data and submit it that way so changes are only saved on update --- RIGS/forms.py | 1 + RIGS/templates/RIGS/event_form.html | 13 ++++++++++++- RIGS/templates/RIGS/item_row.html | 4 ++-- RIGS/templates/RIGS/item_table.html | 4 ++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/RIGS/forms.py b/RIGS/forms.py index 9e883252..e7541421 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -10,6 +10,7 @@ class EventForm(forms.ModelForm): meet_at = forms.DateTimeField(input_formats=datetime_input_formats, required=False) access_at = forms.DateTimeField(input_formats=datetime_input_formats, required=False) name = forms.CharField(min_length=3) + class Meta: model = models.Event fields = ['is_rig', 'name', 'venue', 'start_date', 'start_time', 'end_date', diff --git a/RIGS/templates/RIGS/event_form.html b/RIGS/templates/RIGS/event_form.html index 77601dd2..3b7de673 100644 --- a/RIGS/templates/RIGS/event_form.html +++ b/RIGS/templates/RIGS/event_form.html @@ -294,7 +294,6 @@ value="{{ object.mic.name|default_if_none:"" }}"/> - {#% include 'RIGS/eventitem_table.html' %#}
@@ -307,6 +306,18 @@
+ +
+
+
+
+ + {% render_field form.notes class+="form-control" %} +
+ {% include "RIGS/item_table.html" %} +
+
+