PageRenderTime 134ms CodeModel.GetById 90ms app.highlight 2ms RepoModel.GetById 29ms app.codeStats 0ms

/django/contrib/gis/db/models/sql/conversion.py

https://code.google.com/p/mango-py/
Python | 27 lines | 15 code | 4 blank | 8 comment | 0 complexity | 5f8e82ceee1af6c9b89c8724196fe9ba MD5 | raw file
 1"""
 2This module holds simple classes used by GeoQuery.convert_values
 3to convert geospatial values from the database.
 4"""
 5
 6class BaseField(object):
 7    empty_strings_allowed = True
 8    def get_internal_type(self):
 9        "Overloaded method so OracleQuery.convert_values doesn't balk."
10        return None
11
12class AreaField(BaseField):
13    "Wrapper for Area values."
14    def __init__(self, area_att):
15        self.area_att = area_att
16
17class DistanceField(BaseField):
18    "Wrapper for Distance values."
19    def __init__(self, distance_att):
20        self.distance_att = distance_att
21
22class GeomField(BaseField):
23    """
24    Wrapper for Geometry values.  It is a lightweight alternative to 
25    using GeometryField (which requires a SQL query upon instantiation).
26    """
27    pass