| author | ymh <ymh.work@gmail.com> |
| Tue, 25 May 2010 02:43:45 +0200 | |
| changeset 29 | cc9b7e14412b |
| permissions | -rw-r--r-- |
| 29 | 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 |
||
10 |
def __eq__(self, other): |
|
11 |
return self.wkt == other.wkt and self.srid == other.srid |
|
12 |
||
13 |
def __str__(self): |
|
14 |
return self.wkt |
|
15 |
||
16 |
def prepare_database_save(self, unused): |
|
17 |
return self |