PageRenderTime 266ms CodeModel.GetById 25ms RepoModel.GetById 15ms app.codeStats 1ms

/django/contrib/gis/db/backends/adapter.py

https://code.google.com/p/mango-py/
Python | 17 lines | 10 code | 3 blank | 4 comment | 1 complexity | 8852c93c29cc07952c11bb731147209d MD5 | raw file
Possible License(s): BSD-3-Clause
  1. class WKTAdapter(object):
  2. """
  3. This provides an adaptor for Geometries sent to the
  4. MySQL and Oracle database backends.
  5. """
  6. def __init__(self, geom):
  7. self.wkt = geom.wkt
  8. self.srid = geom.srid
  9. def __eq__(self, other):
  10. return self.wkt == other.wkt and self.srid == other.srid
  11. def __str__(self):
  12. return self.wkt
  13. def prepare_database_save(self, unused):
  14. return self