diff options
author | Jessica Tallon <xray7224@googlemail.com> | 2013-08-14 16:16:49 +0100 |
---|---|---|
committer | Jessica Tallon <jessica@megworld.co.uk> | 2014-07-22 23:13:14 +0100 |
commit | 2b7b9de32e53d34635059afc571ac1a318e41071 (patch) | |
tree | 07ba5119c7e9867604c545dd83c5de20401383f6 /mediagoblin/db/models.py | |
parent | 3015d31a79dcb12b641d70f36eda6536f36a04c8 (diff) | |
download | mediagoblin-2b7b9de32e53d34635059afc571ac1a318e41071.tar.lz mediagoblin-2b7b9de32e53d34635059afc571ac1a318e41071.tar.xz mediagoblin-2b7b9de32e53d34635059afc571ac1a318e41071.zip |
Make sure new media has a new uuid added on
Diffstat (limited to 'mediagoblin/db/models.py')
-rw-r--r-- | mediagoblin/db/models.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 02392792..e1b37aa0 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -237,6 +237,10 @@ class NonceTimestamp(Base): timestamp = Column(DateTime, nullable=False, primary_key=True) +def create_uuid(): + """ Creates a new uuid which is suitable for use in a URL """ + return base64.urlsafe_b64encode(uuid.uuid4().bytes).strip("=") + class MediaEntry(Base, MediaEntryMixin): """ TODO: Consider fetching the media_files using join |