Working with namedtuple
and I'm trying to put a query into it.
build = namedtuple('build', 'x y z')
build(x=DB.query(x).filter(x.id == 'query').first(),
y=DB.query(y).filter(y.id == 'query').first(),
z=DB.query(z).filter(z.id == 'query').first())
When I actually try to access x
with print build.x.id
I get:
AttributeError: 'property' object has no attribute 'id'
I think this has to do with having a query within the namedtuple, and I'm just doing it wrong or it isn't designed to do this. I've googled around and I don't see much on this.