[sqlalchemy] onupdate Column attribute with joined table inheritance question

2009-03-02 Thread John Fries
Hi all, I am having a problem that is identical to the one mentioned last year on this list: http://groups.google.com/group/sqlalchemy/browse_thread/thread/efd3993c94c8d162/37943cda02151f2b?lnk=gstq=onupdate+inheritance#37943cda02151f2b I have Engineer and Manager tables that are inheriting from

[sqlalchemy] Re: onupdate Column attribute with joined table inheritance question

2009-03-02 Thread Michael Bayer
On Mar 2, 2009, at 2:16 PM, John Fries wrote: Hi all, I am having a problem that is identical to the one mentioned last year on this list: http://groups.google.com/group/sqlalchemy/browse_thread/thread/efd3993c94c8d162/37943cda02151f2b?lnk=gstq=onupdate+inheritance#37943cda02151f2b I

[sqlalchemy] Re: onupdate Column attribute with joined table inheritance question

2009-03-02 Thread John Fries
Thanks Michael! That should have been obvious to me, but for some reason I couldn't figure it out. On Mon, Mar 2, 2009 at 11:24 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Mar 2, 2009, at 2:16 PM, John Fries wrote: Hi all, I am having a problem that is identical to the one

[sqlalchemy] Weird mapper() behaviour (bug?)

2009-03-02 Thread Karlo Lozovina
Hi guys! Here goes the code sample: from sqlalchemy import create_engine, MetaData from sqlalchemy import Table, Column, ForeignKey, Integer from sqlalchemy.orm import sessionmaker, mapper, relation metadata = MetaData() engine = create_engine('sqlite:///:memory:', echo=True) parent_table =

[sqlalchemy] Re: Weird mapper() behaviour (bug?)

2009-03-02 Thread Michael Bayer
its a bug, there's an isinstance(str) that should be isinstance(basestring). please file a trac ticket. On Mar 2, 2009, at 6:26 PM, Karlo Lozovina wrote: Hi guys! Here goes the code sample: from sqlalchemy import create_engine, MetaData from sqlalchemy import Table, Column, ForeignKey,

[sqlalchemy] Re: Weird mapper() behaviour (bug?)

2009-03-02 Thread Karlo Lozovina
On Mar 3, 1:03 am, Michael Bayer mike...@zzzcomputing.com wrote: its a bug, there's an isinstance(str) that should be   isinstance(basestring).  please file a trac ticket. Done, here it is: http://www.sqlalchemy.org/trac/ticket/1330 -- Karlo Lozovina

[sqlalchemy] Re: export and import JSON from database (JSON type)

2009-03-02 Thread eLuke
On Feb 28, 10:50 am, Michael Bayer mike...@zzzcomputing.com wrote: A method like this would work: def from_json(self,json): json_obj = simplejson.loads(json) for k, v in json_obj.values(): setattr(self, k, v) if you're concerned about dates you can use a date-based

[sqlalchemy] Infinite recursion in sqlalchemy/orm/attributes.py when running under debugger

2009-03-02 Thread Gunnlaugur Briem
Hi, I have a table-mapped attribute that is dependent on two other attributes: from sqlalchemy import Table, MetaData, Column, Text, create_engine, Integer from sqlalchemy.orm import mapper, synonym class Foo(object): def _get_name(self): return self._name def _set_name(self,