[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-18 Thread Christian Démolis
Hello, Thx for the answer, thx to Alexandre to translate my mail. Sorry, i continue in english, i tried to do that at the end of my declaration file : Base.metadata.create_all(engine) import sqlalchemy.orm.query class MyQuery(sqlalchemy.orm.query.Query): def __init__(*arg, **kw):

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-18 Thread Alexandre Conrad
In Python, you have to pass self as first argument to all methods of a class: class MyQuery(sqlalchemy.orm.query.Query): def __init__(self, *arg, **kw): ... Alex 2009/9/18 Christian Démolis christiandemo...@gmail.com: Hello, Thx for the answer, thx to Alexandre to translate my

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-18 Thread Christian Démolis
^^ I m so shameful It works very well now. I post the subclass complete if anyone need it in future Base.metadata.create_all(engine) import sqlalchemy.orm.query from sqlalchemy.orm.query import Query class Query(Query): def __init__(self, *arg, **kw): print I pass here

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-17 Thread Alexandre Conrad
2009/9/17 Christian Démolis christiandemo...@gmail.com: How can i force sqlalchemy to refresh an object when i did a session.query??? You may want look at this: http://www.sqlalchemy.org/docs/05/session.html#refreshing-expiring You may, as well, look at expunging. Alex

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-17 Thread Christian Démolis
Bonjour, Tu es français je pense au vu de ton prénom. Je continue donc en français. En fait j'ai 25000 lignes de codes derrière moi et j'aimerai éviter d'avoir à ajouter tous les refresh ou les session.query().populate_existing() partout dans mon code J'ai tenté en vain de surcharger la méthode

[sqlalchemy] Re: SQL ALCHEMY instantly refresh

2009-09-17 Thread Michael Bayer
Alexandre Conrad wrote: Christian, 2009/9/17 Christian Démolis christiandemo...@gmail.com: Bonjour, Tu es français je pense au vu de ton prénom. Je continue donc en français. Nice guess. I understand it feels more comfortable writing in French rather than in English, but many people