This may be a stupid question but I can't find any clear answers.
How do I change the display in the Django Admin so the Pointfield does not show up like a OpenLayer Map but as a regular input field. I need to see the long, lat for debugging..
Do i have to change the field type? Widgets?
Thanks!
Update
This is how I managed -at last- to keep separate fields for lattitude and longitude without having to save them in the database since the values are already saved in the PointField.
The idea is :
models.py
admin.py
forms.py
From the source code of PointField we see that its form class uses the OpenLayersWidget which inherits from the BaseGeometryWidget.
The conclusion is that in this class, the variable display_raw is by default set to
False
.If you set it to
True
inyourapp/admin.py
, you will get a textbox with lat and long and other data, useful for debugging purposes:There is also a way to have both a map and manual insertion of longitude / latitude permanently (not only for debugging).
The idea is to use FloatFields to insert the Longitude/Latitude and update the PointField with the inserted data.
You can override a widget with another in Django admin. From the documentation -
This overrides
TextField
withRichTextEditorWidget
. Just find the field type for point field and override it with TextField.