polymodel

ndb.StructuredProperty not calling ndb.PolyModel subclass methods

六眼飞鱼酱① 提交于 2019-12-20 06:36:48
问题 While storing ndb.Polymodel superclasses as an ndb.StructuredProperty, I was unable to access subclass methods; superclass methods were called instead and raising NotImplementedError's. Here is an abridged version of what I am trying to accomplish. class Recipient(polymodel.PolyModel): name = ndb.StringProperty() def PrettyPrinting(self): raise NotImplementedError, 'Rawr' class ShippingRecipient(Recipient): address_line_one = ndb.StringProperty() #there are other properties, but they aren't

AppEngine NDB PolyModel getting properties

不羁的心 提交于 2019-12-12 01:34:49
问题 I am having a problem with appengine that I can't seem to figure out: from google.appengine.ext import ndb from google.appengine.ext.ndb import polymodel class Item(polymodel.PolyModel): name = ndb.StringProperty() type = ndb.StringProperty(choices=["Medical","Food"]) sub_category_type = ndb.StringProperty() sub_category_sub_type = ndb.StringProperty() class MedicalItem(Item): med_sub_type = ndb.StringProperty() can_split_item = ndb.BooleanProperty() class ItemInHouse(ndb.Model): item = ndb

how to cleanly remove ndb properties

こ雲淡風輕ζ 提交于 2019-11-28 17:59:50
in my app i need to remove a few of my models properties. i checked out this link but the first issue is that the properties are on a polymodel and there is no way im going to switch to an expando for the time to remove the properties, im not even shure what could happen if i change a polymodel to an expando . so how do i remove properties from existing entities? i was thinking to set all StringProperty to None and then remove these from the model schema and redeploy. one of those properties is a BooleanProperty , i can't set this one to None right?! or an ndb.PickleProperty ... how should i

how to cleanly remove ndb properties

送分小仙女□ 提交于 2019-11-27 10:59:05
问题 in my app i need to remove a few of my models properties. i checked out this link but the first issue is that the properties are on a polymodel and there is no way im going to switch to an expando for the time to remove the properties, im not even shure what could happen if i change a polymodel to an expando . so how do i remove properties from existing entities? i was thinking to set all StringProperty to None and then remove these from the model schema and redeploy. one of those properties