diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-08-22 21:48:45 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-08-22 21:48:45 -0500 |
commit | 894fa564e718af7398f6f368eb3ac0dcb4d45e1f (patch) | |
tree | 9508a08f8d6598d1040cea44287c0e42af1a1ad6 /mediagoblin/db/models.py | |
parent | 3a8c3a38559f2f81d6155c2349fcddc5ecd6ef28 (diff) | |
parent | 132aa9d97a32abfe86bc5de3ea4e2fa62ddc3793 (diff) | |
download | mediagoblin-894fa564e718af7398f6f368eb3ac0dcb4d45e1f.tar.lz mediagoblin-894fa564e718af7398f6f368eb3ac0dcb4d45e1f.tar.xz mediagoblin-894fa564e718af7398f6f368eb3ac0dcb4d45e1f.zip |
Merge branch 'master' into jwandborg-f482_media_attachments
Conflicts:
mediagoblin/config_spec.ini
mediagoblin/edit/forms.py
mediagoblin/edit/views.py
mediagoblin/submit/views.py
mediagoblin/templates/mediagoblin/user_pages/media.html
Diffstat (limited to 'mediagoblin/db/models.py')
-rw-r--r-- | mediagoblin/db/models.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 4ef2d928..b6e52441 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -162,6 +162,8 @@ class MediaEntry(Document): queued for processing. This is stored in the mg_globals.queue_store storage system. + - queued_task_id: celery task id. Use this to fetch the task state. + - media_files: Files relevant to this that have actually been processed and are available for various types of display. Stored like: {'thumb': ['dir1', 'dir2', 'pic.png'} @@ -170,7 +172,8 @@ class MediaEntry(Document): critical to this piece of media but may be usefully relevant to people viewing the work. (currently unused.) - - thumbnail_file: Deprecated... we should remove this ;) + - fail_error: path to the exception raised + - fail_metadata: """ __collection__ = 'media_entries' @@ -190,6 +193,7 @@ class MediaEntry(Document): # For now let's assume there can only be one main file queued # at a time 'queued_media_file': [unicode], + 'queued_task_id': unicode, # A dictionary of logical names to filepaths 'media_files': dict, @@ -198,8 +202,10 @@ class MediaEntry(Document): # record form 'attachment_files': list, - # This one should just be a single file record - 'thumbnail_file': [unicode]} + # If things go badly in processing things, we'll store that + # data here + 'fail_error': unicode, + 'fail_metadata': dict} required_fields = [ 'uploader', 'created', 'media_type', 'slug'] @@ -291,6 +297,13 @@ class MediaEntry(Document): def uploader(self): return self.db.User.find_one({'_id': self['uploader']}) + def get_fail_exception(self): + """ + Get the exception that's appropriate for this error + """ + if self['fail_error']: + return util.import_component(self['fail_error']) + class MediaComment(Document): """ |