Permalink
Browse files

Refs #7742 -- Removed oldforms bits from `contrib.gis` app.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8295 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent dd842ad commit cec69eb70d1e2f84dc5a7fb172da88a79b0f5063 @gdub gdub committed Aug 11, 2008
Showing with 1 addition and 36 deletions.
  1. +1 −7 django/contrib/gis/db/models/fields/__init__.py
  2. +0 −29 django/contrib/gis/oldforms/__init__.py
@@ -1,11 +1,9 @@
from django.contrib.gis import forms
# Getting the SpatialBackend container and the geographic quoting method.
from django.contrib.gis.db.backend import SpatialBackend, gqn
-# GeometryProxy, GEOS, Distance, and oldforms imports.
+# GeometryProxy, GEOS, and Distance imports.
from django.contrib.gis.db.models.proxy import GeometryProxy
from django.contrib.gis.measure import Distance
-from django.contrib.gis.oldforms import WKTField
-
# The `get_srid_info` function gets SRID information from the spatial
# reference system table w/o using the ORM.
from django.contrib.gis.models import get_srid_info
@@ -190,10 +188,6 @@ def get_db_prep_save(self, value):
else:
return SpatialBackend.Adaptor(self.get_geometry(value))
- def get_manipulator_field_objs(self):
- "Using the WKTField (oldforms) to be our manipulator."
- return [WKTField]
-
# The OpenGIS Geometry Type Fields
class PointField(GeometryField):
_geom = 'POINT'
@@ -1,29 +0,0 @@
-from django.core.validators import ValidationError
-from django.oldforms import LargeTextField
-from django.contrib.gis.geos import GEOSException, GEOSGeometry
-
-class WKTField(LargeTextField):
- "An oldforms LargeTextField for editing WKT text in the admin."
- def __init__(self, *args, **kwargs):
- super(WKTField, self).__init__(*args, **kwargs)
- # Overridding the validator list.
- self.validator_list = [self.isValidGeom]
-
- def render(self, data):
- # Returns the WKT value for the geometry field. When no such data
- # is present, return None to LargeTextField's render.
- if isinstance(data, GEOSGeometry):
- return super(WKTField, self).render(data.wkt)
- elif isinstance(data, basestring):
- return super(WKTField, self).render(data)
- else:
- return super(WKTField, self).render(None)
-
- def isValidGeom(self, field_data, all_data):
- try:
- g = GEOSGeometry(field_data)
- except GEOSException:
- raise ValidationError('Valid WKT or HEXEWKB is required for Geometry Fields.')
-
-
-

0 comments on commit cec69eb

Please sign in to comment.