Hi,SQLAlchemy populates an instance's __dict__ with lazily related instances when the attributes for these instances are first accessed (see here for an ancient and huge discussion on the topic; I thought it's better to start afresh).This breaks code that assumes __dict__ encapsulates object state (see here for a real world example when using flask-restful).
While several workarounds may alleviate this, I think the best approach here would be to create proxy objects to all relations in any instance's __dict__. These proxies can be transparently replaced with the real thing upon first access
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/i5jIMdCcKwMJ.
To post to this group, send email to sqlal...@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.