You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

adapter.py 481B

12345678910111213141516171819
  1. class WKTAdapter:
  2. """
  3. An adaptor for Geometries sent to the MySQL and Oracle database backends.
  4. """
  5. def __init__(self, geom):
  6. self.wkt = geom.wkt
  7. self.srid = geom.srid
  8. def __eq__(self, other):
  9. return (
  10. isinstance(other, WKTAdapter) and
  11. self.wkt == other.wkt and self.srid == other.srid
  12. )
  13. def __hash__(self):
  14. return hash((self.wkt, self.srid))
  15. def __str__(self):
  16. return self.wkt