#43 Lat/Long Check when place is submitted
This commit is contained in:
		@@ -44,7 +44,15 @@ class PlaceForm(forms.ModelForm):
 | 
			
		||||
    class Meta:
 | 
			
		||||
        model = Place
 | 
			
		||||
        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 Meta:
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,14 @@ class PlaceCreateView(MultiplePlaceImageUploadMixin, IsAuthenticatedMixin, View)
 | 
			
		||||
                self.request,
 | 
			
		||||
                _('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):
 | 
			
		||||
    template_name = 'place/place_delete.html'
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user