Re: [sqlalchemy] Filter on relation???

2009-11-25 Thread Christian Démolis
Ok, i already use session.query, no problem with my code. It works very well at the moment. I m just curious about advanced functionnality of my favourite orm :) Thanks to you, i have discovered that we can : - define associationproxy - define a properties which returns the result of a

[sqlalchemy] dynamic relation forgets join condition on .count() ?

2009-11-25 Thread Wichert Akkerman
I have a data model which has accounts and events, and a many-to-many relation between the two using a CalendarEvent class. It boils down to this: class Account(BaseObject): __tablename__ = account id = schema.Column(id, types.Integer(), primary_key=True) class Event(BaseObject):

Re: [sqlalchemy] dynamic relation forgets join condition on .count() ?

2009-11-25 Thread Michael Bayer
Wichert Akkerman wrote: I have a data model which has accounts and events, and a many-to-many relation between the two using a CalendarEvent class. It boils down to this: class Account(BaseObject): __tablename__ = account id = schema.Column(id, types.Integer(), primary_key=True)

Re: [sqlalchemy] dynamic relation forgets join condition on .count() ?

2009-11-25 Thread Wichert Akkerman
On 2009-11-25 16:15, Michael Bayer wrote: Wichert Akkerman wrote: I have a data model which has accounts and events, and a many-to-many relation between the two using a CalendarEvent class. It boils down to this: class Account(BaseObject): __tablename__ = account id =

Re: [sqlalchemy] dynamic relation forgets join condition on .count() ?

2009-11-25 Thread Michael Bayer
Wichert Akkerman wrote: I was expecting the join to automatically created since the Account.calendar relation depends on it. Adding a .join(model.Event) to the query before the filter() calls indeed fixes this. Does SQLAlchemy indeed assume that my usage of models.Event as query filters has

[sqlalchemy] pass any field as a keyword param to the constructor?

2009-11-25 Thread Lukasz Szybalski
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/GenericOrmBaseClass class Recall(OrmObject):pass mapper(Recall,recall_table) record=Recall(RECORD_ID=RECORD_ID,CAMPNO=CAMPNO,MAKETXT=MAKETXT) session.add(record) session.flush() This is not working if using the example set in the url. Is setattr

[sqlalchemy] Dynamic mapper issue

2009-11-25 Thread Kalium
Hi, I'm coming to grief trying to create a Mapper on the fly. At first I tried this class Dynamic(object): pass Dynamic.mapper = mapper(Dynamic, self.j); self.j is a join statement. This now maps all the columns from the tables in the join statement. Which is fine.

Re: [sqlalchemy] Weird error with update

2009-11-25 Thread Ilia Kharin
one advantage of this syntax is that Python will raise an exception that last_access does not exist. yes, and it will be seen at first running -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to