diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-02-01 15:42:44 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-02-01 22:02:35 +0100 |
commit | 57f8d263e1773be7458f09f9b3f1b7571cb0e026 (patch) | |
tree | 2699786545edb496cb7089e71cb1bc76b9989dad /api-docs/source/modules.rst | |
parent | d728c636b987fa774948ffc122fd080153d8f906 (diff) | |
download | mediagoblin-57f8d263e1773be7458f09f9b3f1b7571cb0e026.tar.lz mediagoblin-57f8d263e1773be7458f09f9b3f1b7571cb0e026.tar.xz mediagoblin-57f8d263e1773be7458f09f9b3f1b7571cb0e026.zip |
Rewrite media_data handling to use relationships
Instead of doing query by hand, use the relationships on
the models to find the media_data. Is is made possible by
the BACKREF_NAME in each models.py, which lets us know the
local attr to ask for.
Also initialize the relationship attribute on new
media_data instead of the media_id. Also do not add it to
the session. This gives us:
- This automatically initializes the other side of the
relationship, which will allow later acces via that way.
- If the media_data is too early in the session, when the
(new) media_entry is not yet in there, this could get
conflicts. Avoid those by not adding to session.
- Uses cascading to commit media_data together with the
media_entry.
Diffstat (limited to 'api-docs/source/modules.rst')
0 files changed, 0 insertions, 0 deletions