mirror of
https://github.com/django/django.git
synced 2025-07-04 01:39:20 +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:
parent
b6359772b1
commit
0bf6355918
12
django/contrib/gis/oldforms/__init__.py
Normal file
12
django/contrib/gis/oldforms/__init__.py
Normal 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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user