﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30049	Multiple problems using gis fields in admin inlines	Lars Solberg	nobody	"My goal is to use a field that looks like this:

{{{
from django.contrib.gis.db import models

class FavoriteLocation(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    location = models.PointField()
}}}

as an extra field on a User. The field-type works on other models, so everything is setup correctly.

However, getting it as a inline is problematic because it doesnt render correctly in the admin.
The admin code looks like this:

{{{
from django.contrib.auth.admin import UserAdmin
from django.contrib.gis import admin

class FavoriteLocationInline(admin.StackedInline):
    model = FavoriteLocation
    extra = 1

class CustomUserAdmin(UserAdmin):
    inlines = (FavoriteLocationInline,)

admin.site.unregister(User)
admin.site.register(User, CustomUserAdmin)
}}}

however, the widget for displaying the field looks blank (see screenshot).

In the doc, It sais I should use ""admin.OSMGeoAdmin"" for my admin class. However, that don't change anything.
Nor changing it to ""class CustomUserAdmin(admin.OSMGeoAdmin, UserAdmin).

If I click add ""another favorite location"", I will also get a text-area field instead of the widget.

Trying to save the model with this broken widget gives me a ""GDALException"" (django.contrib.gis.gdal.error.GDALException: OGR failure.)
Note that this widget works on other admin-pages I have.."	Bug	new	GIS	2.1	Normal		gis, admin		Unreviewed	0	0	0	0	0	0
