I'm not sure if this will be helpful, but I found the types decorators
very useful :

http://www.sqlalchemy.org/docs/core/types.html#typedecorator-recipes

You can basically keep a list() in your instances and do something
when you want to save it in the database (such as saving them as a
comma separated string, or in json format...)

Evertime you "rebuild" an instance from the database you'll get a
list() and everytime you serialize in the datbase you can make that
list be a comma separated string (or json)

2011/9/2 Sebastian Elsner <sebast...@risefx.com>:
>  Hello,
>
> I want to serialize a python list, which by convention can only contain
> strings and save it to mysql database in on column. I was thinking about an
> unicode column and an attribute event which just does a str(list) for saving
> and a eval(string) for access. I am not sure though if this is a good
> method, or if there even is a buildin method.
>
> Thanks for your suggestions!
>
> Sebastian
>
> --
> 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.
>
>

-- 
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