-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: MapField (from lat/long fields) #282
Comments
Thank for your suggestion. Feel free to submit a PR. You can check the JSONField implementation for reference |
I am studying https://jowilf.github.io/starlette-admin/advanced/custom-field/#detail-page and it seems to take only 1 field:
In my case, I want to build a "composite field": given N fields, show as one. lat/long as Map is an obvious one. Another obvious one is to have a single "full address" field from N columns (country/state/city,street name and number). So, I guess the more general issue is: how can "composite fields" be added to starlet-admin? Maybe |
In reality we are talking about a synthetic field, computed from N fields from the entity. I may want to show raw lat&long as floats AND ALSO an interactive map widget, computed from these 2 values. I guess I want a field where I pass the whole row/entity, and not just 1 attributes. Is that supported? |
You can override the BaseField.parse_obj function to handle it |
I have an entity which has 2 float fields: latitude and longitude. I would like to render this as a map. Does it make sense / is it possible to use a synthetic MapField to CREATE/UPDATE/DELETE the 2 concrete fields containing latitude/longitude? Just like Dates get a nice Date Picker instead of text string, it would be cool if lat/long field pairs could get a map a la Google Maps. By dragging the map etc the lat/long would be updated.
Thanks for listening.
Upvote & Fund
The text was updated successfully, but these errors were encountered: