Dot-Notation for MediaEntry.media_data
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 4 Dec 2011 19:26:36 +0000 (20:26 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Mon, 5 Dec 2011 20:08:58 +0000 (21:08 +0100)
mediagoblin/db/models.py
mediagoblin/media_types/video/processing.py

index aeee69dd5d555bec406440741e0d468c9d67a83d..569c3600a2ecc4448563a19d30e5c1c23d460b3d 100644 (file)
@@ -131,7 +131,7 @@ class MediaEntry(Document):
        For example, images might contain some EXIF data that's not appropriate
        to other formats.  You might store it like:
 
-         mediaentry['media_data']['exif'] = {
+         mediaentry.media_data['exif'] = {
              'manufacturer': 'CASIO',
              'model': 'QV-4000',
              'exposure_time': .659}
@@ -139,7 +139,7 @@ class MediaEntry(Document):
        Alternately for video you might store:
 
          # play length in seconds
-         mediaentry['media_data']['play_length'] = 340
+         mediaentry.media_data['play_length'] = 340
 
        ... so what's appropriate here really depends on the media type.
 
index 6125e49ce66e1f3454e0ea8cf84a953d922bc9fd..93f16e86e6ba8d76dc42fb45238de59f3b43838b 100644 (file)
@@ -75,7 +75,7 @@ def process_video(entry):
         entry['media_files']['webm_640'] = medium_filepath
 
         # Save the width and height of the transcoded video
-        entry['media_data']['video'] = {
+        entry.media_data['video'] = {
             u'width': transcoder.dst_data.videowidth,
             u'height': transcoder.dst_data.videoheight}