-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[geo] Restrict to points only #151 #175
base: master
Are you sure you want to change the base?
Conversation
@nemesisdesign Please can review this? |
Fixed the issue by adding a clean method to the location model. This method ensures that when the geometry is not None, it should be an instance of a Point Geometry else a ValidationError is raised Fixes #151
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good, the reason I left this open was that I thought we should prevent the user from entering other type of geometries in the admin. Maybe we can do that by overriding the widget in a way that forces it to use the widget for point, look for geom_type
here: https://github.com/makinacorpus/django-leaflet/blob/master/leaflet/forms/widgets.py
Do you think you can do that?
😄 I can have a look at it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also needs to be rebased on the current master
0a1c550
to
bbe0dab
Compare
Fixed the issue by adding a clean method
to the location model. This method
ensures that when the geometry is not
None, it should be an instance of a Point
Geometry else a ValidationError is raised
Fixed #151