I have a model with a gis_models.GeometryField
.
class MyModel(django.db.models):
area = gis_models.GeometryField(null=True, blank=True)
I'm displaying this model on Django admin but i'm using https://github.com/makinacorpus/django-leaflet library.
I already have 100+ rows in the database. when I open the admin page for any of those entries, I'm able to see a polygon being draw. that's perfect! take another case where I have to add a new polygon from the admin page. I am able to draw the map and save the entry. it works as expected. I can see the polygon on the map next time I open that entry on the map.
the problem is when I add a new polygon I don't know what polygons are already there in the DB. so sometimes I add a new polygon that overlaps with existing ones. I was thinking of displaying all the available polygons on the map so that next time I add a new one I won't touch those points on the map. how can we display all the polygons (MultiPolygon) just for the /add/ page?
PS: I couldn't find the method that I can override in Django admin class to render all the polygons. also, I couldn't find the relevant question on StackOverflow or any other source. so please if you think I didn't search enough please point me to the link that you think would be helpful to me for this specific case.