Re: [sqlalchemy] Get properties of a class mapped with SqlAlchemy (and its sqlalchemy.orm.synonym)

2010-12-21 Thread Hector Blanco
First of all, thank you for replying. I don't really know if I understood your idea. I dug a bit more in the User class (not the instance, but what it would be self.__class__) and the problem is that both password and _password have a __get__: I changed the getProperties method a bit, to

Re: [sqlalchemy] Get properties of a class mapped with SqlAlchemy (and its sqlalchemy.orm.synonym)

2010-12-21 Thread Hector Blanco
I found a maybe way... but I don't know if it's good idea... the propertyProxy instances have a field called descriptor which the InstrumentedAttribute don't have... so I can always do this: -- def getProperties4(cls): properties = list()

Re: [sqlalchemy] Get properties of a class mapped with SqlAlchemy (and its sqlalchemy.orm.synonym)

2010-12-21 Thread Hector Blanco
Ah... much better :) def getProperties2(instance): properties = list() mapper = sqlalchemy.orm.object_mapper(instance) for prop in mapper.iterate_properties: if isinstance(prop, sqlalchemy.orm.properties.SynonymProperty):

[sqlalchemy] Get properties of a class mapped with SqlAlchemy (and its sqlalchemy.orm.synonym)

2010-12-20 Thread Hector Blanco
Hello all! I have an application running under Python2.6 and the classes are set up with properties (in a Python2.4 style, though). Everything seems to be working fine with SqlAlchemy (version 0.6.5, just in case) as it explains here:

Re: [sqlalchemy] Get properties of a class mapped with SqlAlchemy (and its sqlalchemy.orm.synonym)

2010-12-20 Thread Michael Bayer
On Dec 20, 2010, at 7:30 PM, Hector Blanco wrote: Hello all! I have an application running under Python2.6 and the classes are set up with properties (in a Python2.4 style, though). Everything seems to be working fine with SqlAlchemy (version 0.6.5, just in case) as it explains here: