[storm] Beginner question: adding referenced objects to store
Michael Bayer
mike_mp at zzzcomputing.com
Wed Jul 1 20:14:48 BST 2009
Neil de Carteret wrote:
> Thanks James. Bug duly filed.
>
> I had read the tutorial, but I was hoping for a quick way to clear and
> set all the related doodads at once, and tripped up because assigning
> a sequence directly does work in another well-known Python ORM ;)
If that other ORM is SQLAlchemy, this is not accurate. Our default
collection type is a list whereas with Storm's ReferenceSet, its a set.
If you set the collection_class to "set" on a SQLA relation(), assigning a
list to that attribute on an instance will raise the exception "TypeError:
Incompatible collection type: list is not set-like" - so we are
maintaining strong typing wrt attribute assignment.
More information about the storm
mailing list