Implementing GeoPtProperty in ndb.#6432
Conversation
ndb/src/google/cloud/ndb/_ports.py
Outdated
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Ported implementations from the Google App Engine SDK. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ndb/src/google/cloud/ndb/_ports.py
Outdated
| return "datastore_types.GeoPt({!r}, {!r})".format(self.lat, self.lon) | ||
|
|
||
| def __str__(self): | ||
| return "{},{}".format(self.lat, self.lon) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| property. | ||
| validator (Callable[[Property, Any], bool]): A validator to be used | ||
| to check values. | ||
| validator (Callable[[~google.cloud.ndb.model.Property, Any], bool]): A |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ndb/src/google/cloud/ndb/_ports.py
Outdated
|
|
||
|
|
||
| @functools.total_ordering | ||
| class GeoPt: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ndb/src/google/cloud/ndb/_ports.py
Outdated
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Ported implementations from the Google App Engine SDK. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ndb/src/google/cloud/ndb/_ports.py
Outdated
| Returns: | ||
| str: The repr for this instance. | ||
| """ | ||
| return "datastore_types.GeoPt({!r}, {!r})".format(self.lat, self.lon) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
0223f6e to
ccc98d1
Compare
a4437de to
8331456
Compare
8331456 to
4b6bc05
Compare
Using `GeoPoint` from `google-cloud-datastore`.
Using `GeoPoint` from `google-cloud-datastore`.
In the process also:
google.cloud.ndb._portsto bring in "necessary" classes from the GAE standard SDKThis is incomplete for now but I wanted to send it so I didn't forget the comments I had about the implementation.