class AddDeviceForm(forms.Form): name = forms.CharField(widget=forms.TextInput(attrs={ "placeholder": "Name", "class": "form-control" })) location = forms.PointField(widget=forms.OSMWidget(attrs={ 'map_width': 1000, 'map_height': 500 })) class Meta: model = Device fields = ('name', 'location') widgets = {'location': LeafletWidget()} class Media: css = { 'all': ( 'https://cdnjs.cloudflare.com/ajax/libs/ol3/3.20.1/ol.css', 'gis/css/ol3.css', ) } js = ( 'https://cdnjs.cloudflare.com/ajax/libs/ol3/3.20.1/ol.js', 'gis/js/OLMapWidget.js', )
class Meta: model = Ad fields = ( "type", "title", "description", "image", "categories", "location_name", "location", ) widgets = { "type": forms.RadioSelect, "categories": forms.CheckboxSelectMultiple, "location_name": LocationWidget, "location": forms.OSMWidget(attrs={ 'map_width': '100%', 'map_height': 400, 'default_zoom': 1 }), }
class UpdatePlaceForm(forms.Form): title = forms.CharField(max_length=100, help_text='Enter a place name') location = forms.PointField(widget=forms.OSMWidget(attrs={ 'map_width': 800, 'map_height': 500 })) description = forms.CharField(max_length=500, help_text='Enter a place description') address = forms.CharField(max_length=250, help_text='Enter a place address') phone = forms.CharField(max_length=10, help_text='Enter a phone number') city = forms.ModelChoiceField(queryset=City.objects.all()) PLACE_TYPE = ( ('a', 'Park'), ('b', 'Restaurant'), ('c', 'Mall'), ('d', 'Amusement park'), ('e', 'Museum'), ('f', 'Beach'), ('g', 'Theater'), ('h', 'Lodge'), ('i', 'Others'), ) type_of_place = forms.ChoiceField( choices=PLACE_TYPE, help_text='Place Type', )
class Meta: model = Project fields = ( "naam", "nummer", "organisaties", "vhe", "pensioenfonds", "statuscontract", "plaats", ) geom = forms.PointField() labels = { "naam": "Projectnaam:", "nummer": "Projectnummer:", "plaats": "Plaats:", "vhe": "Aantal verhuureenheden:", "pensioenfonds": "Pensioenfonds:", "statuscontract": "Contractstatus:", } widgets = { "point": forms.OSMWidget(attrs={ "default_lat": 52.37, "default_lon": 4.895, }), }
class StartProjectForm(ModelForm): plaats = forms.PointField(widget=forms.OSMWidget(attrs={ "default_lat": 52.37, "default_lon": 4.895, })) class Meta: model = Project fields = ( "belegger", "projectmanager", "naam", "nummer", "vhe", "pensioenfonds", "plaats", ) geom = forms.PointField() labels = { "belegger": "Belegger:", "projectmanager": "Projectmanager:", "naam": "Projectnaam:", "nummer": "Projectnummer:", "plaats": "Plaats:", "vhe": "Aantal verhuureenheden:", "pensioenfonds": "Pensioenfonds:", } widgets = { "point": forms.OSMWidget(attrs={ "default_lat": 52.37, "default_lon": 4.895, }) }
class BusinessForm(forms.ModelForm): """ form to create neighbourhood by users """ location = forms.PointField(widget=forms.OSMWidget(attrs={ 'map_width': 1024, 'map_height': 600 })) class Meta: model = Business fields = [ 'id', 'name', 'owner_name', 'national_id', 'phone', 'email', 'postal_address', 'status', 'opening_days', 'opening', 'closing', 'address', 'country', 'county', 'city', 'town', 'village', 'location', 'description', 'company', 'image', 'image1', 'image2', 'image3', 'image4', 'image5', 'category', 'verified' ]
class HousingForm(forms.ModelForm): """ Form to Create Posts """ location = forms.PointField(widget=forms.OSMWidget(attrs={ 'map_width': 1024, 'map_height': 600 })) class Meta: model = Housing fields = [ 'id', 'name', 'owner_name', 'national_id', 'phone', 'email', 'postal_address', 'status', 'opening_days', 'opening', 'closing', 'address', 'country', 'county', 'city', 'town', 'village', 'location', 'description', 'company', 'image', 'image1', 'image2', 'image3', 'image4', 'image5', 'size', 'firnished', 'unfirnished', 'amenities', 'price', 'mode_of_payment', 'category', 'verified' ]
class MyGeoForm(forms.Form): point = forms.PointField(widget=forms.OSMWidget(attrs={'map_width': 800, 'map_height': 500}))