[sqlalchemy] Re: M2M relationship

2008-07-14 Thread Heston James - Cold Beans
Hi Michael, what I see immediately is that you're declaring mutliple declarative_bases and multiple MetaData objects. All of the Table objects which relate to one another need to share the same underlying MetaData object, and the declarative_base() function also uses a MetaData

[sqlalchemy] Re: tree/graph persistency, concurency-safe?

2008-07-14 Thread az
On Monday 14 July 2008 04:05:43 Michael Bayer wrote: On Jul 13, 2008, at 1:47 PM, [EMAIL PROTECTED] wrote: hi all i have a tree/graph of nodes and links inbetween (= explicit m2m), and many users can simultaneusly change nodes/links. i need to get all-reachable-from-x in one query - so

[sqlalchemy] Re: Little Bug - orm.object_mapper.get_property

2008-07-14 Thread Kless
I refer to the docstring and this is my version: SQLAlchemy-0.5.0beta1- py2.5.egg On Jul 14, 1:59 am, Michael Bayer [EMAIL PROTECTED] wrote: On Jul 13, 2008, at 1:38 PM, Kless wrote: *orm.object_mapper* has an argument called 'raiseerror', and it works ok.

[sqlalchemy] Problem: TypeError: Incompatible collection type

2008-07-14 Thread Marcos
Hello! First, sorry about my english! I'm having this little problem, and i can't see where is my error. I have the follow code: code from sqlalchemy import * from sqlalchemy.orm import * class Cuenta(object): def __init__(self, codigo, de_titulo, descripcion, padre): self.codigo =

[sqlalchemy] Re: Problem: TypeError: Incompatible collection type

2008-07-14 Thread az
AFAIRemember, by default, relation assumes it is a collection, and not a reference - as it is in your case (padre means parent, right?) give relation( ... use_list=False). On Monday 14 July 2008 15:21:48 Marcos wrote: Hello! First, sorry about my english! I'm having this little problem, and

[sqlalchemy] Re: Problem: TypeError: Incompatible collection type

2008-07-14 Thread Marcos
a reference - as it is in your case (padre means parent, right?) Yes, padre means parent give relation( ... use_list=False). Mmmm... no: code Traceback (most recent call last): File /home/marcos/easyeclipse-python-1.2.2.2/workspace/mine/jContab/ src/jContab/test.py, line 20, in ?

[sqlalchemy] Re: Problem: TypeError: Incompatible collection type

2008-07-14 Thread az
eh, sorry, RTFM, uselist without _underscore On Monday 14 July 2008 16:42:05 Marcos wrote: a reference - as it is in your case (padre means parent, right?) Yes, padre means parent give relation( ... use_list=False). Mmmm... no: code Traceback (most recent call last): File

[sqlalchemy] Re: M2M relationship

2008-07-14 Thread Heston James - Cold Beans
Hello Michael, what I see immediately is that you're declaring mutliple declarative_bases and multiple MetaData objects. All of the Table objects which relate to one another need to share the same underlying MetaData object, and the declarative_base() function also uses a MetaData

[sqlalchemy] Re: Problem: TypeError: Incompatible collection type

2008-07-14 Thread Marcos
uselist without _underscore Thanks, that works. RTFM And thanks for the insult, I will try to read more before to ask. Marcos --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this

[sqlalchemy] Re: M2M relationship

2008-07-14 Thread Michael Bayer
On Jul 14, 2008, at 11:02 AM, Heston James - Cold Beans wrote: Hello Michael, what I see immediately is that you're declaring mutliple declarative_bases and multiple MetaData objects. All of the Table objects which relate to one another need to share the same underlying MetaData

[sqlalchemy] Re: M2M relationship

2008-07-14 Thread King Simon-NFHD78
Heston wrote: [SNIP] Above you talk about a global module in the application which creates the Base and metadata, but I don't understand how these can then be accessed by other classes around the application? Do you have any good sample code or a link to a decent tutorial? Seems

[sqlalchemy] Re: Problem: TypeError: Incompatible collection type

2008-07-14 Thread Michael Bayer
On Jul 14, 2008, at 10:46 AM, [EMAIL PROTECTED] wrote: eh, sorry, RTFM, uselist without _underscore if that was not addressed to yourself, try to refrain from using that kind of tone...even if it were meant humorously, things like that don't travel well via email.

[sqlalchemy] Re: Little Bug - orm.object_mapper.get_property

2008-07-14 Thread Michael Bayer
not seeing it: # pydoc sqlalchemy.orm.mapperlib.Mapper.get_property Help on method get_property in sqlalchemy.orm.mapperlib.Mapper: sqlalchemy.orm.mapperlib.Mapper.get_property = get_property(self, key, resolve_synonyms=False, raiseerr=True) unbound sqlalchemy.orm.mapper.Mapper method

[sqlalchemy] SQLAlchemy 0.5beta2 released

2008-07-14 Thread Michael Bayer
0.5 beta2 released 0.5 is pretty much done for the 0.5.0 release, we're not anticipating any more backwards-incompatible changes, or only very small ones. beta2 is to get the current functionality out there (even though most 0.5 beta users might be using trunk anyway). Also see the

[sqlalchemy] Re: Little Bug - orm.object_mapper.get_property [Wrong]

2008-07-14 Thread Kless
Sorry! I suppose that I was confused. On Jul 14, 8:34 pm, Michael Bayer [EMAIL PROTECTED] wrote: not seeing it: # pydoc sqlalchemy.orm.mapperlib.Mapper.get_property Help on method get_property in sqlalchemy.orm.mapperlib.Mapper: sqlalchemy.orm.mapperlib.Mapper.get_property =

[sqlalchemy] unexpected behavior with relation and filter_by

2008-07-14 Thread Jon
With the following schema: Table(u'account', meta, Column(u'id', Integer(), primary_key=True, nullable=False), Column(u'name', String(length=5, convert_unicode=False, assert_unicode=None), nullable=False)) Table(u'license', meta, Column(u'id', Integer(), primary_key=True, nullable=False),