How can I enter the latitude and longitude of a PointField
when creating/editing an entry using the OSMGeoAdmin
or GeoModelAdmin
? Currently, I have a map where I can place the point by clicking on the map. I'd like to keep this behavior but also be able to manually specify the exact values.
Details
I have a Location
model with a PointField
attribute.
# models.py
class Location(models.Model):
name = models.CharField(max_length=255, db_index=True)
point = PointField(blank=True, null=True)
# admin.py
from django.contrib.gis.admin import OSMGeoAdmin
@admin.register(Location)
class LocationAdmin(OSMGeoAdmin):
list_display = ("id", "name")