-
Notifications
You must be signed in to change notification settings - Fork 1
/
forms.py
52 lines (44 loc) · 1.52 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# __BEGIN_LICENSE__
# Copyright (C) 2008-2010 United States Government as represented by
# the Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# __END_LICENSE__
from django import forms
from django.forms import widgets
from geocamMapSet.models import LibraryLayer
class LibraryLayerUploadForm(forms.ModelForm):
class Meta:
model = LibraryLayer
fields = ('localCopy',)
HOSTING_CHOICES = (('external',
'Display the externally hosted file (recommended)'),
('local',
'Display a copy of the file hosted on this site'
),
)
class LibraryLayerUrlForm(forms.ModelForm):
hosting = forms.ChoiceField(HOSTING_CHOICES)
class Meta:
model = LibraryLayer
fields = ('externalUrl',)
class LibraryLayerMetaForm(forms.ModelForm):
url = forms.URLField(widget=widgets.TextInput(attrs=dict(size=60)),
required=False)
acceptTerms = forms.BooleanField(label='Terms', required=True)
class Meta:
model = LibraryLayer
fields = ('localCopy',
'externalUrl',
'name',
'description',
'coverage',
'creator',
'contributors',
'publisher',
'rights',
'license',
'morePermissions',
'acceptTerms',
'type',
'complete'
)