如何重写需要查询子类的特定属性的继承类方法?你知道吗
我不知道该怎么办。这就是我得到的:
class base_class:
@classmethod
def a_method(cls, something):
return ndb.Query(kind=cls.__name__).fetch(keys_only=True)
@classmethod
def calls_a_method(cls, size=1, soemthing):
entity_keys = cls.a_method(something)
class child_class(base_class):
a_property = ndb.BooleanProperty()
def another_method():
stuff = child_class.calls_a_method() #?
如何重写基类中的\u方法,以便它还将筛选出子类的\u属性为False的键?你知道吗
我认为,如果跨方法分解查询,可以在子类中构造一个自定义查询:
像这样的怎么样?你知道吗
相关问题 更多 >
编程相关推荐