PageRenderTime 26ms CodeModel.GetById 16ms RepoModel.GetById 1ms 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
Possible License(s): BSD-3-Clause
  1. """
  2. This module holds simple classes used by GeoQuery.convert_values
  3. to convert geospatial values from the database.
  4. """
  5. class BaseField(object):
  6. empty_strings_allowed = True
  7. def get_internal_type(self):
  8. "Overloaded method so OracleQuery.convert_values doesn't balk."
  9. return None
  10. class AreaField(BaseField):
  11. "Wrapper for Area values."
  12. def __init__(self, area_att):
  13. self.area_att = area_att
  14. class DistanceField(BaseField):
  15. "Wrapper for Distance values."
  16. def __init__(self, distance_att):
  17. self.distance_att = distance_att
  18. class GeomField(BaseField):
  19. """
  20. Wrapper for Geometry values. It is a lightweight alternative to
  21. using GeometryField (which requires a SQL query upon instantiation).
  22. """
  23. pass