Hello,
sqlalchemy seems to be the proper tool for my needs but I can't figure
out how to design my project or set the ORM properly.
Let's say, I build a music database, storing tracks and their
associated metadata in an sql-like database defined as such :
TRACK_TABLE ( ident *, url , duration )
METADATA_TABLE ( track_ident *, field_name *, field_content )
(track_ident, field_name) being the primary key for METADATA_TABLE...
intuitively, a meaningful object for a metadata set would be a
dictionary-like object. The name and number of fields being unknown in
advance but stored in the METADATA_TABLE as one row per field.
Here is the question : how may I use the ORM to map
a table :
123 / title / waka waka
123 / artist / shakira
123 / featuring / my sister
to an object like :
metadata.title = "waka waka"
metadata.artist = "shakira"
metadata.featuring = "my sister"
or a dictionary like :
metadata = { "title" : "waka waka", "artist" : "shakira",
"featuring" : "my sister" }
or whatsoever ...
the solution might also be in rewrite of the sql schema :)
thanks for your advices
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.