def formfield_for_dbfield(self, db_field, **kwargs):
        if isinstance(db_field, models.GeometryField):
            request = kwargs.pop('request', None)
            # Setting the widget with the newly defined widget.
            kwargs['widget'] = self.get_map_widget(db_field)
            return db_field.formfield(**kwargs)
        else:
            return super(GeoModelAdmin, self).formfield_for_dbfield(db_field, **kwargs)
Overloaded from ModelAdmin so that an OpenLayersWidget is used
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/admin/options.py/GeoModelAdmin.formfield_for_dbfield