On May 2, 2012, at 8:34 AM, Moritz Schlarb wrote:
> Thank you, Michael!
>
> But could I achieve it somehow using hybrid properties and a case statement?
>
> I tried something like:
>
> @hybrid_property
> def time(self):
> return self._time or self.event.time
>
> @time.
Thank you, Michael!
But could I achieve it somehow using hybrid properties and a case statement?
I tried something like:
@hybrid_property
def time(self):
return self._time or self.event.time
@time.expression
def time(cls):
return case([(cls._time != None, cls
On Apr 21, 2012, at 7:06 AM, Moritz Schlarb wrote:
>
> So basically, a Child object may set it's own value for time, but if it's not
> set, it uses the value from its parent.
> This works, but I would also like to be able to do something like:
>
> session.query(Child).filter(Child.parent.anoth
Hi at all,
I haven't found something by googling, but I'm also not sure about the
right search terms, so I hope some can help me here.
I have a model like this:
class Parent(DeclarativeBase):
id = Column(Integer, primary_key=True)
time = Column(Float)
another_id = Column(Integer)
cl