You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 8, 2022. It is now read-only.
So some funny things happen if you insert a date property before 1900. NDB half lets you put the value in the database but ProtoRPC will not return it from the database. Which leads to some weird behavior.
class Patient(EndpointsModel):
name = ndb.StringProperty()
user = EndpointsUserProperty(required=True, raise_unauthorized=True)
date_of_birth = ndb.DateProperty()
age = ndb.IntegerProperty()
def calculate_age(self):
today = date.today()
birthday = self.date_of_birth
self.age = today.year - birthday.year - ((today.month, today.day) < (birthday.month , birthday.day))
def _pre_put_hook(self):
if self.date_of_birth:
self.calculate_age()
@endpoints.api(name='patient', version='vGDL',
description='API for patient')
class PatientApi(remote.Service):
First it throws a 503 when storing a value before hand
but it succeeded at putting it
Second is it looks up all queries that contain this entity
The only solution when this happens seems to be deleting the entity. Its simple enough to work around by raising a bad request exception. It just seems tedious to do everytime I add a date.
The text was updated successfully, but these errors were encountered:
here are some other values I managed to add anything before 1900 in the year would not come back out. The issue only seems to affect years. Also Datastore has a pretty robust knowledge of leap years.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
So some funny things happen if you insert a date property before 1900. NDB half lets you put the value in the database but ProtoRPC will not return it from the database. Which leads to some weird behavior.
class Patient(EndpointsModel):
@endpoints.api(name='patient', version='vGDL',
description='API for patient')
class PatientApi(remote.Service):
First it throws a 503 when storing a value before hand



but it succeeded at putting it
Second is it looks up all queries that contain this entity
The only solution when this happens seems to be deleting the entity. Its simple enough to work around by raising a bad request exception. It just seems tedious to do everytime I add a date.
The text was updated successfully, but these errors were encountered: