Skip to content

Implementing GeoPtProperty in ndb.#6432

Merged
dhermes merged 4 commits intogoogleapis:masterfrom
dhermes:ndb-add-GeoPtProperty
Nov 7, 2018
Merged

Implementing GeoPtProperty in ndb.#6432
dhermes merged 4 commits intogoogleapis:masterfrom
dhermes:ndb-add-GeoPtProperty

Conversation

@dhermes
Copy link
Contributor

@dhermes dhermes commented Nov 7, 2018

In the process also:

  • Adding google.cloud.ndb._ports to bring in "necessary" classes from the GAE standard SDK

This is incomplete for now but I wanted to send it so I didn't forget the comments I had about the implementation.

@dhermes dhermes requested a review from chrisrossi November 7, 2018 01:19
@dhermes dhermes requested a review from crwilcox as a code owner November 7, 2018 01:19
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 7, 2018
# 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.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

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.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

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.

@dhermes dhermes added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 7, 2018


@functools.total_ordering
class GeoPt:

This comment was marked as spam.

# 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.

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.

@dhermes dhermes force-pushed the ndb-add-GeoPtProperty branch from 0223f6e to ccc98d1 Compare November 7, 2018 17:13
@dhermes dhermes removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 7, 2018
@dhermes dhermes force-pushed the ndb-add-GeoPtProperty branch 2 times, most recently from a4437de to 8331456 Compare November 7, 2018 18:58
@dhermes dhermes force-pushed the ndb-add-GeoPtProperty branch from 8331456 to 4b6bc05 Compare November 7, 2018 18:58
@dhermes dhermes merged commit e3c44d8 into googleapis:master Nov 7, 2018
@dhermes dhermes deleted the ndb-add-GeoPtProperty branch November 7, 2018 19:36
chrisrossi pushed a commit to chrisrossi/google-cloud-python that referenced this pull request Feb 22, 2019
Using `GeoPoint` from `google-cloud-datastore`.
parthea pushed a commit that referenced this pull request Nov 24, 2025
Using `GeoPoint` from `google-cloud-datastore`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: ndb cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants