you have a relationship named "options". to work around this, set up
the relation as:
assign_mapper(class, table, properties={
'options':relation(someotherclass, collection_class=list)
})
On Jan 26, 11:11 am, Alexandre CONRAD <[EMAIL PROTECTED]> wrote:
> When I use the trunk (0.3.4dev-r2255) I get the following:
>
> >>> client = model.Client.get(1)
> >>> client
> <mp.models.clients.Client object at 0x107e1d0>
> >>> client.delete()
> Traceback (most recent call last):
> File "<console>", line 1, in ?
> File "build/bdist.linux-x86_64/egg/sqlalchemy/ext/assignmapper.py",
> line 16, in do
> File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/session.py", line
> 323, in delete
> File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/mapper.py", line
> 1126, in cascade_iterator
> File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/properties.py",
> line 154, in cascade_iterator
> File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> line 688, in get_history
> File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> line 85, in get_history
> File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> line 184, in get
> File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> line 335, in __init__
> ArgumentError: Collection type <class 'sqlalchemy.orm.query.Query'> has
> no append() or add() method
>
> Regards,
> --
> Alexandre CONRAD
>
> Alexandre CONRAD wrote:
> > Hello,
>
> > I'm using SQLAlchemy 0.3.4. I'm having the following problem when trying
> > to delete an object:
>
> > >>> client = model.Client.get(1)
> > >>> client
> > <mp.models.clients.Client object at 0x1088210>
> > >>> client.delete()
> > Traceback (most recent call last):
> > File "<console>", line 1, in ?
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/ext/assignmapper.py",
> > line 16, in do
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/session.py", line
> > 323, in delete
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/mapper.py", line
> > 1126, in cascade_iterator
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/properties.py",
> > line 154, in cascade_iterator
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> > line 686, in get_history
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> > line 85, in get_history
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> > line 190, in get
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> > line 526, in commit_attribute
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> > line 28, in <lambda>
> > File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/attributes.py",
> > line 383, in __iter__
> > TypeError: iteration over non-sequence
>
> > Regards,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---