#43 Lat/Long Check when place is submitted
This commit is contained in:
parent
b845cc054a
commit
dc79b9d05c
@ -44,7 +44,15 @@ class PlaceForm(forms.ModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Place
|
model = Place
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
exclude = ['submitted_by']
|
exclude = ['submitted_by', 'latitude', 'longitute']
|
||||||
|
|
||||||
|
latitude = forms.IntegerField(
|
||||||
|
widget=forms.NumberInput(attrs={'min':-90,'max': 90,'type': 'number'})
|
||||||
|
)
|
||||||
|
|
||||||
|
longitude = forms.IntegerField(
|
||||||
|
widget=forms.NumberInput(attrs={'min':-180,'max': 180,'type': 'number'})
|
||||||
|
)
|
||||||
|
|
||||||
class PlaceImageForm(forms.ModelForm):
|
class PlaceImageForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -104,7 +104,14 @@ class PlaceCreateView(MultiplePlaceImageUploadMixin, IsAuthenticatedMixin, View)
|
|||||||
self.request,
|
self.request,
|
||||||
_('Please fill in all required fields.')
|
_('Please fill in all required fields.')
|
||||||
)
|
)
|
||||||
return render(request, 'place/place_create.html', context={'form': place_form})
|
return render(
|
||||||
|
request=request,
|
||||||
|
template_name='place/place_create.html',
|
||||||
|
context={
|
||||||
|
'place_form': place_form,
|
||||||
|
'place_image_form': PlaceImageForm()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
class PlaceDeleteView(IsAuthenticatedMixin, IsPlaceSubmitterMixin, DeleteView):
|
class PlaceDeleteView(IsAuthenticatedMixin, IsPlaceSubmitterMixin, DeleteView):
|
||||||
template_name = 'place/place_delete.html'
|
template_name = 'place/place_delete.html'
|
||||||
|
Loading…
Reference in New Issue
Block a user