gis: The `verbose_name` positional keyword now works for `GeometryField`, thanks springmeyer; removed DOS line endings from Oracle & MySQL spatial backends, thanks cramm.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8224 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2008-08-06 21:40:00 +00:00
parent 34a3bd5225
commit b00e82fe2c
3 changed files with 219 additions and 216 deletions

View File

@ -1,5 +1,4 @@
from django.contrib.gis import forms from django.contrib.gis import forms
from django.db import connection
# Getting the SpatialBackend container and the geographic quoting method. # Getting the SpatialBackend container and the geographic quoting method.
from django.contrib.gis.db.backend import SpatialBackend, gqn from django.contrib.gis.db.backend import SpatialBackend, gqn
# GeometryProxy, GEOS, Distance, and oldforms imports. # GeometryProxy, GEOS, Distance, and oldforms imports.
@ -21,7 +20,7 @@ class GeometryField(SpatialBackend.Field):
# Geodetic units. # Geodetic units.
geodetic_units = ('Decimal Degree', 'degree') geodetic_units = ('Decimal Degree', 'degree')
def __init__(self, srid=4326, spatial_index=True, dim=2, **kwargs): def __init__(self, verbose_name=None, srid=4326, spatial_index=True, dim=2, **kwargs):
""" """
The initialization function for geometry fields. Takes the following The initialization function for geometry fields. Takes the following
as keyword arguments: as keyword arguments:
@ -50,6 +49,10 @@ class GeometryField(SpatialBackend.Field):
# Setting the dimension of the geometry field. # Setting the dimension of the geometry field.
self._dim = dim self._dim = dim
# Setting the verbose_name keyword argument with the positional
# first parameter, so this works like normal fields.
kwargs['verbose_name'] = verbose_name
super(GeometryField, self).__init__(**kwargs) # Calling the parent initializtion function super(GeometryField, self).__init__(**kwargs) # Calling the parent initializtion function
### Routines specific to GeometryField ### ### Routines specific to GeometryField ###