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
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):
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)
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 =
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
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
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.
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