예제 #1
0
파일: forms.py 프로젝트: priestd09/Geotrek
 def __init__(self, *args, **kwargs):
     super(BaseTrekForm, self).__init__(*args, **kwargs)
     self.fields['topology'].widget = LineTopologyWidget()
     self.fields['points_reference'].label = ''
     self.fields['points_reference'].widget.target_map = 'topology'
     self.fields['parking_location'].label = ''
     self.fields['parking_location'].widget.target_map = 'topology'
예제 #2
0
 def __init__(self, *args, **kwargs):
     super(TrekForm, self).__init__(*args, **kwargs)
     self.fields['topology'].widget = LineTopologyWidget()
     self.fields['web_links'].widget = SelectMultipleWithPop(choices=self.fields['web_links'].choices,
                                                             add_url=WebLink.get_add_url())
     # Make sure (force) that name is required, in default language only
     self.fields['name_%s' % settings.LANGUAGE_CODE].required = True
예제 #3
0
 def __init__(self, *args, **kwargs):
     super(BaseTrekForm, self).__init__(*args, **kwargs)
     modifiable = self.fields['topology'].widget.modifiable
     # TODO: We should change LeafletWidget to keep modifiable.
     # Init of TopologyForm -> commonForm -> mapentityForm
     # already add a leafletwidget with modifiable
     self.fields['topology'].widget = LineTopologyWidget()
     self.fields['topology'].widget.modifiable = modifiable
     self.fields['points_reference'].label = ''
     self.fields['points_reference'].widget.target_map = 'topology'
     self.fields['parking_location'].label = ''
     self.fields['parking_location'].widget.target_map = 'topology'
예제 #4
0
 def __init__(self, *args, **kwargs):
     super(TrailForm, self).__init__(*args, **kwargs)
     self.fields['topology'].widget = LineTopologyWidget()
예제 #5
0
 def __init__(self, *args, **kwargs):
     super(EdgeForm, self).__init__(*args, **kwargs)
     modifiable = self.fields['topology'].widget.modifiable
     self.fields['topology'].widget = LineTopologyWidget()
     self.fields['topology'].widget.modifiable = modifiable