Hi,
I have a little problem with outer joins (I use QSLAlchemy 0.5.6).
I have two tables, managing tasks and activities :
class Task(Base):
__tablename__ = 'tache'
id = Column(Integer, Sequence('seq_tache_id'), primary_key=True)
libelle = Column(Unicode(50))
description =
Hi,
I created two classes Resource and BaseMedia, and BaseMedia is a
subclass of Resource. The table mapping is implemented as below:
class Resource(Database.Base):
__tablename__ = resources
createUserId = Column(create_user_id, Integer,
ForeignKey(users.id), nullable=True,
Hi,
Problem is solved with last SQLAlchemy 0.7.6 !!
I was a little affrayed to change but only had minor incompatibilities :-)
For anybody interested, the good syntax is :
session.query(Activity, TaskAM.libelle, TaskPM.libelle) \
.outerjoin(TaskAM, Activity.task_am) \
you can probably do it in all versions including 0.5 just using two separate
outerjoin calls:
outerjoin(Activity.task_am).\
outerjoin(Activity.task_pm)
each new call to outerjoin() starts back from the parent Activity.
the TaskAM/TaskPM targets can be implicit there.
On Dec 1, 2011, at 11:12
On Nov 30, 2011, at 7:48 PM, Hector Blanco wrote:
Hello everyone!
I am using (yeah, still) SqlAlchemy 0.6.8 and I'm using an
AttributeExtension to build permissions of users.
class UserGroupExtension(AttributeExtension):
def set(self, state, value, oldvalue, initiator):
On Dec 1, 2011, at 1:32 AM, Wubin wrote:
Hi,
I created two classes Resource and BaseMedia, and BaseMedia is a
subclass of Resource. The table mapping is implemented as below:
class Resource(Database.Base):
__tablename__ = resources
createUserId = Column(create_user_id,
I'm not able to reproduce that, and also this code should likely be replaced by
our existing topological sort code. Can you provide a succinct reproducing
example ?
On Dec 1, 2011, at 2:22 AM, Robert Forkel wrote:
Hi,
trying to use Inspector.get_table_names with order_by='foreign_key'
nevermind, I need to randomize that list in order to trigger it
On Dec 1, 2011, at 1:42 PM, Michael Bayer wrote:
I'm not able to reproduce that, and also this code should likely be replaced
by our existing topological sort code. Can you provide a succinct
reproducing example ?
On Dec
Hi Michael,
Thank you for the reply, the logs I got from the sqlalchemy shown as below:
2011-12-01 13:53:49,062 INFO sqlalchemy.engine.base.Engine.0x...29cc UPDATE
base_media SET name=%s WHERE base_media.id = %s
2011-12-01 13:53:49,062 INFO [sqlalchemy.engine.base.Engine.0x...29cc]
UPDATE
thats fixed in r2b66b5abf755, will be in 0.7.4 or you can get the tip off the
download page.
On Dec 1, 2011, at 1:47 PM, Michael Bayer wrote:
nevermind, I need to randomize that list in order to trigger it
On Dec 1, 2011, at 1:42 PM, Michael Bayer wrote:
I'm not able to reproduce
On Dec 1, 2011, at 1:32 AM, Wubin wrote:
Hi,
I created two classes Resource and BaseMedia, and BaseMedia is a
subclass of Resource. The table mapping is implemented as below:
class Resource(Database.Base):
__tablename__ = resources
createUserId = Column(create_user_id,
@validates... Where have you been? Oh... In the documentation, all
along. The day I learn to read, I'll conquer the world
It works great. Thank you!
2011/12/1 Michael Bayer mike...@zzzcomputing.com:
On Nov 30, 2011, at 7:48 PM, Hector Blanco wrote:
Hello everyone!
I am using (yeah, still)
Hi Michael,
I really appreciate your quick reply, and that you made me clear for this
issue.
Actually my goal is to log when an object was last modified, and who did
it. So I guess I need to use MapperExtension to implement this.
Thank you very much, and have a nice day.
On Thu, Dec 1, 2011 at
Well, my case is a bit different. I'm writing a nightly running batch
script. And this script is not running inside pyramid context, which means
it is not the model that called from the framework. Instead, I arrange it
to run by system cron. But, I'm trying to utilize the pyramid environment
Hi,
Another quite strange problem using SQLAlchemy...
I've created two classes, with matching interfaces build with
zope.interface and zope.schema packages ; a web form is build with
z3c.form package ; everything is fine !
My problem is quite simple to describe : I have a main class which is
a
On Dec 1, 2011, at 4:29 PM, Geo wrote:
And I was suspecting it is the reason of the complex joins in usage, because
I have other code that doing things in the same way,
the structure of the Query/ SELECT statement that gets you back some data has
no connection on how that data behaves
On Dec 1, 2011, at 5:38 PM, Thierry Florac wrote:
Hi,
So it seems that when resources are in the form and NOT modified, the
matching task is not flagged dirty and is not saved in database. I
just don't understand why !!!
Only a full usage example would make it clear in this case.Again
2011/12/2 Michael Bayer mike...@zzzcomputing.com:
On Dec 1, 2011, at 5:38 PM, Thierry Florac wrote:
Hi,
So it seems that when resources are in the form and NOT modified, the
matching task is not flagged dirty and is not saved in database. I
just don't understand why !!!
Only a full usage
On Dec 1, 2011, at 7:09 PM, Thierry Florac wrote:
2011/12/2 Michael Bayer mike...@zzzcomputing.com:
On Dec 1, 2011, at 5:38 PM, Thierry Florac wrote:
Hi,
So it seems that when resources are in the form and NOT modified, the
matching task is not flagged dirty and is not saved in
Hi,
I do not see anywhere in the docs a way to pass custom attributes to
event listeners:
event.listen(cls, 'before_insert', before_insert_listener, arg1, arg2,
kwarg1 = 'value', kwarg2 = 'value2')
so that the before_insert_listener can have mixed signature:
def before_insert_listener(mapper,
On Dec 1, 2011, at 7:24 PM, Łukasz Czuja wrote:
Hi,
I do not see anywhere in the docs a way to pass custom attributes to
event listeners:
event.listen(cls, 'before_insert', before_insert_listener, arg1, arg2,
kwarg1 = 'value', kwarg2 = 'value2')
so that the before_insert_listener can
How about functools.partial ?
As far as I know, functools.partial will simply do this.
Usually, I import this when I need to make an argument-less function equip
extra arguments.
Best regards,
Tate
-Original Message-
From: Michael Bayer mike...@zzzcomputing.com
Sender:
Not sure if this helps or not, but how about using a lambda that that calls
your function with the arguments you want? This is the solution I've been using
for passing arguments to wxPython event handlers. This tutorial might help:
http://wiki.wxpython.org/Passing%20Arguments%20to%20Callbacks
Ok I found the solution, just move the first query into the transaction
body:
import transaction
try:
transaction.begin()
x_members = session.query(Distributor)...
for member in x_members:
.
except:
transaction.abort()
BTW, I'm using pyramid framework, which is using the
Yes, I think also lambda can be good one.
Though lambda reduces an effort to type a predefined function,
functools.partial is a bit familiar to me.
Best regards,
Tate
-Original Message-
From: Jackson, Cameron cameron.jack...@thalesgroup.com.au
Sender: sqlalchemy@googlegroups.com
Date:
25 matches
Mail list logo