Update lots of things

This commit is contained in:
Livvy Mackintosh
2017-06-16 18:06:22 +02:00
parent 90b508e3b0
commit 0811936382
23 changed files with 557 additions and 106 deletions

25
apps/map/forms.py Normal file
View File

@ -0,0 +1,25 @@
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from leaflet.forms.widgets import LeafletWidget
from .models import CaseStudy
class CaseStudyForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(CaseStudyForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_id = 'case-study-form'
self.helper.form_class = 'form-horizontal'
self.helper.form_method = 'post'
self.helper.form_action = 'submit'
self.helper.label_class = 'col-lg-2'
self.helper.field_class = 'col-lg-8'
self.helper.add_input(Submit('submit', 'Submit'))
class Meta:
model = CaseStudy
fields = '__all__'
widgets = {'location': LeafletWidget()}