Merge remote branch 'remotes/gullydwarf-cfdv/b372_rmdbfield_thumbnail_file'

This commit is contained in:
Christopher Allan Webber 2011-08-11 21:31:48 -05:00
commit 01360fbd98
2 changed files with 11 additions and 6 deletions

View File

@ -52,3 +52,13 @@ def mediaentry_mediafiles_main_to_original(database):
document['media_files']['original'] = original document['media_files']['original'] = original
collection.save(document) collection.save(document)
@RegisterMigration(3)
def mediaentry_remove_thumbnail_file(database):
"""
Use media_files['thumb'] instead of media_entries['thumbnail_file']
"""
database['media_entries'].update(
{'thumbnail_file': {'$exists': True}},
{'$unset': {'thumbnail_file': 1}},
multi=True)

View File

@ -169,8 +169,6 @@ class MediaEntry(Document):
- attachment_files: A list of "attachment" files, ones that aren't - attachment_files: A list of "attachment" files, ones that aren't
critical to this piece of media but may be usefully relevant to people critical to this piece of media but may be usefully relevant to people
viewing the work. (currently unused.) viewing the work. (currently unused.)
- thumbnail_file: Deprecated... we should remove this ;)
""" """
__collection__ = 'media_entries' __collection__ = 'media_entries'
@ -196,10 +194,7 @@ class MediaEntry(Document):
# The following should be lists of lists, in appropriate file # The following should be lists of lists, in appropriate file
# record form # record form
'attachment_files': list, 'attachment_files': list}
# This one should just be a single file record
'thumbnail_file': [unicode]}
required_fields = [ required_fields = [
'uploader', 'created', 'media_type', 'slug'] 'uploader', 'created', 'media_type', 'slug']