diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-08-11 21:31:48 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-08-11 21:31:48 -0500 |
commit | 01360fbd98a8830a27cf4301ec5c4bc180208909 (patch) | |
tree | 37595d50b70c87a902c30fa1ed5ace696a7a9fcc | |
parent | 9f6ea47586f78370c42dc9b45782f398bebf7d2e (diff) | |
parent | 84abd2bbc43e2d92d429c679f49e237207057150 (diff) | |
download | mediagoblin-01360fbd98a8830a27cf4301ec5c4bc180208909.tar.lz mediagoblin-01360fbd98a8830a27cf4301ec5c4bc180208909.tar.xz mediagoblin-01360fbd98a8830a27cf4301ec5c4bc180208909.zip |
Merge remote branch 'remotes/gullydwarf-cfdv/b372_rmdbfield_thumbnail_file'
-rw-r--r-- | mediagoblin/db/migrations.py | 10 | ||||
-rw-r--r-- | mediagoblin/db/models.py | 7 |
2 files changed, 11 insertions, 6 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index 6a8ebcf9..8c088145 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -52,3 +52,13 @@ def mediaentry_mediafiles_main_to_original(database): document['media_files']['original'] = original 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) diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 4ef2d928..aff2a65b 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -169,8 +169,6 @@ class MediaEntry(Document): - attachment_files: A list of "attachment" files, ones that aren't 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 ;) """ __collection__ = 'media_entries' @@ -196,10 +194,7 @@ class MediaEntry(Document): # The following should be lists of lists, in appropriate file # record form - 'attachment_files': list, - - # This one should just be a single file record - 'thumbnail_file': [unicode]} + 'attachment_files': list} required_fields = [ 'uploader', 'created', 'media_type', 'slug'] |