-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
ndb/src/google/cloud/ndb/model.py
Outdated
@@ -1679,8 +1680,8 @@ class BlobProperty(Property): | |||
default (bytes): The default value for this property. | |||
choices (Iterable[bytes]): A container of allowed values for this | |||
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`.
In the process also:
google.cloud.ndb._ports
to 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.