1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

gis: geographic oldforms, allows editing of geometries as WKT in admin

git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@4883 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2007-03-31 21:18:05 +00:00
parent b6359772b1
commit 0bf6355918

View File

@ -0,0 +1,12 @@
from django.oldforms import LargeTextField
from django.contrib.gis.geos import hex_to_wkt
class WKTField(LargeTextField):
"An oldforms LargeTextField for editing WKT text in the admin."
def render(self, data):
# PostGIS uses EWKBHEX to store its values internally, converting
# to WKT for the admin first.
return super(WKTField, self).render(hex_to_wkt(data))