Commit b00e82fe authored by Justin Bronn's avatar Justin Bronn
Browse files

gis: The `verbose_name` positional keyword now works for `GeometryField`,...

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
parent 34a3bd52
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
from django.contrib.gis import forms
from django.db import connection
# Getting the SpatialBackend container and the geographic quoting method.
from django.contrib.gis.db.backend import SpatialBackend, gqn
# GeometryProxy, GEOS, Distance, and oldforms imports.
@@ -21,7 +20,7 @@ class GeometryField(SpatialBackend.Field):
    # Geodetic units.
    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
        as keyword arguments:
@@ -50,6 +49,10 @@ class GeometryField(SpatialBackend.Field):
        # Setting the dimension of the geometry field.
        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

    ### Routines specific to GeometryField ###
+59 −59

File changed.

Contains only whitespace changes.

+154 −154

File changed.

Contains only whitespace changes.