You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, and thanks for this fantastic project (and django-leaflet).
Using the leaflet widget on modelForms (where the model has a corresponding geom field, e.g. PointField()) works as expected, however when using forms.Form the behavior is not consistent.
The docs say that form widgets are rendered with Leaflet automatically if django-leaflet is available, but this does not seem to be the case.
Taking a simple example:
class SampleForm(forms.Form): location = djgeojson.fields.PointField()
From the docs, we expect that when this form is rendered, there will be a leaflet widget for the location field, which does not seem to work.
The text was updated successfully, but these errors were encountered:
Thanks Gagaro, this works and looking at the djgeojson/fields.py I can see why. It's not immediately obvious to me why this is not required when using forms.ModelForm. In that case, the PointField is automatically rendered as a leaflet widget, which is the behavior expected from reading the docs. I guess this has something to do with forms.ModelForm itself?
Perhaps it would be useful to update the documentation for both the ModelForm and Form use cases?
Hi, and thanks for this fantastic project (and
django-leaflet
).Using the leaflet widget on
modelForms
(where the model has a corresponding geom field, e.g.PointField()
) works as expected, however when usingforms.Form
the behavior is not consistent.The docs say that form widgets are rendered with Leaflet automatically if
django-leaflet
is available, but this does not seem to be the case.Taking a simple example:
class SampleForm(forms.Form): location = djgeojson.fields.PointField()
From the docs, we expect that when this form is rendered, there will be a leaflet widget for the
location
field, which does not seem to work.The text was updated successfully, but these errors were encountered: