admin.OSMGeoAdmin problems with MultiPointField

39 views
Skip to first unread message

cka...@googlemail.com

unread,
Nov 8, 2010, 5:38:03 AM11/8/10
to geodjango
Hi,

here is my models.py

[...]
gemeinde = models.ForeignKey(Gemeindegrenzen)
geo_lines = models.MultiLineStringField(srid=21781, dim=2, blank=True,
null=True)
geo_points = models.MultiPointField(srid=21781, dim=2, blank=True,
null=True)
geo_polygons = models.MultiPolygonField(srid=21781, dim=2, blank=True,
null=True)
[...]

and a custom geometry_check function:
def geometry_check(self):
check = [self.gemeinde.the_geom.contains(self.geo_points),
self.gemeinde.the_geom.contains(self.geo_polygons),
self.gemeinde.the_geom.contains(self.geo_lines)]
return all(check)

I call the geometry_check in the Models clean function, with works
very well.

in my admin.py I have:

class SchwachstelleAdmin(admin.OSMGeoAdmin):
openlayers_url = "URL TO OpenLayer.js"
display_srid = 4326
map_srid = 900913

Now my problem:
If I insert more than one points in the django admin interface, all
points get saved correctly, but if I want to view the points again in
the django-admin, I only get the first point displayed in the admin.

LOL, here is my fix, now it works like a charm again :-)

>>>> Don't use custom openlayers_url!!! <<<<

Thanky,
Christian
Reply all
Reply to author
Forward
0 new messages