[sqlalchemy] Mapping via multiple joined tables

2010-11-19 Thread Mene
Hi, I want an voting application, for a huge building. Each user has one room at each floor of the building. The room is shared with other users and may change over time. Each user has one vote for each room he is in (so also one per level) to vote for things like the color the room shall be

Re: [sqlalchemy] Mapping via multiple joined tables

2010-11-19 Thread Michael Bayer
On Nov 19, 2010, at 6:37 AM, Mene wrote: Hi, I want an voting application, for a huge building. Each user has one room at each floor of the building. The room is shared with other users and may change over time. Each user has one vote for each room he is in (so also one per level) to vote

[sqlalchemy] Longer tuple passed to query.get doesn't throw exception

2010-11-19 Thread Eoghan Murray
With a class with 3 primary key columns, e.g. class MyClass(Entity): a = Field(Unicode(64), primary_key=True) b = Field(Unicode(64), primary_key=True) c = Field(Unicode(64), primary_key=True) ... If you pass 4 values to query.get; MyClass.get(('a_val',

[sqlalchemy] Re: Assigning to a deferred column

2010-11-19 Thread Eoghan Murray
Thanks for the reply, yes it is a mutable type: import jsonpickle class JsonType(types.MutableType, types.TypeDecorator): impl = types.Unicode def process_bind_param(self, value, engine): return unicode(jsonpickle.encode(value)) def

[sqlalchemy] Re: Weird error when adding a new object

2010-11-19 Thread Alvaro Reinoso
Ok, This is the code: @staticmethod def insert(string, mode): Insert a new item given a string screenGroup = ScreenGroup() session = rdb.Session() try: if mode == XML:

Re: [sqlalchemy] Re: Weird error when adding a new object

2010-11-19 Thread Michael Bayer
The most suspicious thing is self.__dict__['foo'] = list() as well as the direct access to self.__dict__['foo']. If self is a mapped object, then thats your issue. Also note this is still an out of context cut-and-paste, if you really want me to figure it out it has to be an isolated test

Re: [sqlalchemy] Re: Assigning to a deferred column

2010-11-19 Thread Michael Bayer
On Nov 19, 2010, at 1:41 PM, Eoghan Murray wrote: I guess I can't disable the mutability flag? not if you're changing the value inline. If you assign a new value, then you don't need mutability. From reading up on mutability:

Re: [sqlalchemy] Longer tuple passed to query.get doesn't throw exception

2010-11-19 Thread Michael Bayer
On Nov 19, 2010, at 1:06 PM, Eoghan Murray wrote: With a class with 3 primary key columns, e.g. class MyClass(Entity): a = Field(Unicode(64), primary_key=True) b = Field(Unicode(64), primary_key=True) c = Field(Unicode(64), primary_key=True) ... If you pass

[sqlalchemy] Re: Weird error when adding a new object

2010-11-19 Thread Alvaro Reinoso
Got it. I just change session.add(screenGroup) to session.merge(screenGroup) and it works. Thank you for you help, it's always really useful. On Nov 19, 3:10 pm, Michael Bayer mike...@zzzcomputing.com wrote: The most suspicious thing is self.__dict__['foo'] = list() as well as the direct

Re: [sqlalchemy] Longer tuple passed to query.get doesn't throw exception

2010-11-19 Thread Michael Bayer
On Nov 19, 2010, at 1:06 PM, Eoghan Murray wrote: With a class with 3 primary key columns, e.g. class MyClass(Entity): a = Field(Unicode(64), primary_key=True) b = Field(Unicode(64), primary_key=True) c = Field(Unicode(64), primary_key=True) ... If you pass

[sqlalchemy] Memory leaks in DecimalResultProcessor

2010-11-19 Thread Taavi Burns
We recently ported our app to 0.6.4, and enabled cextensions. Our app's memory usage ballooned, and HTTP response times with it due to the extra load on the garbage collector. Turns out the DecimalResultProcessor cextension code is a bit leaky! :) I've opened ticket

Re: [sqlalchemy] Memory leaks in DecimalResultProcessor

2010-11-19 Thread Michael Bayer
On Nov 19, 2010, at 11:19 PM, Taavi Burns wrote: We recently ported our app to 0.6.4, and enabled cextensions. Our app's memory usage ballooned, and HTTP response times with it due to the extra load on the garbage collector. Turns out the DecimalResultProcessor cextension code is a bit