On Sep 22, 2009, at 8:34 AM, Julien Cigar wrote:

>
> Hello,
>
> I'm busy to make a kind of "mapper exporter/serializer". My goal is to
> be able to serialize (in JSON, XML, ...) any Mapper object (including
> relations, etc)
>
> At the moment I've the following code (not finished at all) :
> http://www.pastie.org/625787
>
> As you can see I'm iterating over mapper.iterate_properties list (line
> 60), and before I goes any further I wondered if it's the right way to
> do it ? (I would like to have all the properties, including column  
> type,
> etc)

its likely the best way at the moment.

>
> Another question: I see that the property "columns" of an
> <sqlalchemy.orm.properties.ColumnProperty> instance is a list and I
> wondered in which cases the list can contains more than one item ?

a single attribute can be mapped to multiple columns explicitly so  
that both columns will always have the same value (see the docs on  
mapping to joins), and its also the case when using composite  
properties.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to