Now that we know which feature the user wants to edit, our next task is to implement the edit feature page itself. To do this, we are going to have to create a custom form with a single input field, named
geometry, that uses a map-editing widget for editing the feature's geometry.
To create this form, we're going to borrow elements from GeoDjango's built-in "admin" interface, in particular the
django.contrib.gis.admin.GeoModelAdmin class. This class provides a method named
get_map_widget() which returns an editing widget which we can then include in a custom-generated form.
The process of building this form is a bit involved, thanks to the fact that we have to create a new
django.forms.Form subclass on-the-fly to be handle the different ...