from mediagoblin.db.mongo import migrations
from mediagoblin.db.mongo.util import ASCENDING, DESCENDING, ObjectId
from mediagoblin.tools.pagination import Pagination
-from mediagoblin.tools import url
+from mediagoblin.tools import url, licenses
from mediagoblin.db.mixin import UserMixin, MediaEntryMixin
###################
"unprocessed": uploaded but needs to go through processing for display
"processed": processed and able to be displayed
+ - license: URI for media's license.
+
- queued_media_file: storage interface style filepath describing a file
queued for processing. This is stored in the mg_globals.queue_store
storage system.
'plugin_data': dict, # plugins can dump stuff here.
'tags': [dict],
'state': unicode,
+ 'license': unicode,
# For now let's assume there can only be one main file queued
# at a time
for media in cursor:
return media.url_for_self(urlgen)
+ def get_license_data(self):
+ """Return license dict for requested license"""
+ return licenses.SUPPORTED_LICENSES[self['license']]
+
@property
def get_uploader(self):
return self.db.User.find_one({'_id': self.uploader})
title=media.title,
slug=media.slug,
description=media.description,
- tags=media_tags_as_string(media.tags))
- license=media.license)
+ tags=media_tags_as_string(media.tags),
+ license=media.license))
form = forms.EditForm(
request.POST,