From 37af09a2e51394c630bf7efd1718b77a574b272d Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 16 May 2011 18:22:13 -0500 Subject: [PATCH] Require that the slug field have only unique values. --- mediagoblin/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mediagoblin/models.py b/mediagoblin/models.py index edb1d46d..cdb06a35 100644 --- a/mediagoblin/models.py +++ b/mediagoblin/models.py @@ -99,6 +99,10 @@ class MediaEntry(Document): 'created': datetime.datetime.utcnow, 'state': u'unprocessed'} + indexes = [ + {'fields': 'slug', + 'unique': True}] + def main_mediafile(self): pass