I should at least clarify that I have @hybrid_test.expression in place for that property and it works when I just do the base 'get me everything' query.
On Monday, June 3, 2019 at 2:13:17 PM UTC-4, Gmoney wrote: > > I'm trying to use load_only and was able to get a really basic example to > work. My problem is that once I try to load one of my hybrid properties, > it fails. > > This code works for any number of basic Column properties but fails once I > add the hybrid property: > > columns = (Task.msg_id, Task.hybrid_test) > > q = (db.session.query(Task).options(load_only(*columns).lazyload('*'))) > > AttributeError: Neither 'hybrid_property' object nor 'ExprComparator' > object associated with Task.hybrid_test has an attribute 'property' > > > Just wondering if I should be able to get this to work if I keep digging > or post a more thorough code snippet, or is it not possible using this > approach? > -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/2661a10c-4741-4e5b-a1e7-2db578c5712b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.