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
Expected result would be that GEO_WIDGET_DEFAULT_LOCATION are set.
Description from user:
I just had to manually set the default location, by overriding the save method. I tried to set:GEO_WIDGET_DEFAULT_LOCATION = {'lat': 45.070312, 'lng': 7.6868565} but when I save the model without touching the location, the location field is set to None (maybe I did something wrong, but with 3 lines of code in the save model I solved the problem).
The text was updated successfully, but these errors were encountered:
I tracked this down and this has been the default behavior from the beginning. I can see the use of storing the default value in the field, no matter if map is touched or not. But I can also see the use of having a None value if untouched, as to indicate the map value has not yet been filled. My plan is this:
Current solution
GEO_WIDGET_DEFAULT_LOCATION only effect what the map widget should show, but user interaction is required for the value to be saved, If not touched, None are stored.
New behavior
GEO_WIDGET_DEFAULT_LOCATION behavior are left unchanged, it only effects the map display.
A new setting GEO_WIDGET_SAVE_DEFAULT_LOCATION is introduced to avoid breaking changes, its False by default. Setting it to True will also save the default location as a field value as well.
Expected result would be that
GEO_WIDGET_DEFAULT_LOCATION
are set.Description from user:
The text was updated successfully, but these errors were encountered: