you'd poke through column_attrs and look at the "deferred" flag.

a good way to figure these things out is to pdb in and use dir(obj) to see what 
attributes it has, it's how i do it anyway when figuring out a lib...


On Aug 14, 2013, at 10:51 PM, Jonathan Vanasco <[email protected]> wrote:

> i'm trying to generate a list of non-deffered columns from an object 
> 
> referencing this example:
> 
>     class Book(Base):
>         __tablename__ = 'book'
> 
>         book_id = Column(Integer, primary_key=True)
>         title = Column(String(200), nullable=False)
>         summary = Column(String(2000))
>         excerpt = deferred(Column(Text))
>         photo = deferred(Column(Binary))
> 
> how can I tell , when dealing with an instance of `Book()`, which columns are 
> deferred or not ?
> 
> i tried inspecting virtually everything in:
> 
>     class_mapper(Book))
> 
> and looked over these multiple times:
> 
>     class_mapper(Book).mapped_table)
>     class_mapper(Book).mapped_table.c)
> 
> but couldn't seem to find anything that works. 
> 
> 
> -- 
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to