Add coordinates autocomplete widget & data (#32)
Just tweaks based on what Carl had already written in dce53630
and b97d421a
This commit is contained in:
@ -2,12 +2,14 @@ from django.urls import reverse
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from crispy_forms.helper import FormHelper
|
||||
from crispy_forms.layout import Submit, Layout, HTML, Fieldset, Div
|
||||
from crispy_forms.bootstrap import Tab, TabHolder, PrependedText, FormActions
|
||||
from dal import autocomplete
|
||||
from leaflet.forms.widgets import LeafletWidget
|
||||
|
||||
from .models import CaseStudy
|
||||
from .models import CaseStudy, SpatialRefSys
|
||||
|
||||
|
||||
class MinimumZoomWidget(LeafletWidget):
|
||||
@ -80,6 +82,12 @@ class ShortCaseStudyForm(BaseCaseStudyForm):
|
||||
class LongCaseStudyForm(BaseCaseStudyForm):
|
||||
"""Long version of the CaseStudy form."""
|
||||
|
||||
coordinate_reference_system = forms.ModelChoiceField(
|
||||
queryset=SpatialRefSys.objects.all(),
|
||||
widget=autocomplete.ModelSelect2(url='srs-autocomplete'),
|
||||
initial=4326,
|
||||
)
|
||||
|
||||
POSITIVE_CASE_TYPE_HELP = {
|
||||
'CREP': _("We are using the World Wind Energy Association's Community Power definition, \
|
||||
which is that a community project is one where at least \
|
||||
|
Reference in New Issue
Block a user