diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-05-16 18:22:13 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-05-16 18:22:13 -0500 |
commit | 37af09a2e51394c630bf7efd1718b77a574b272d (patch) | |
tree | e6ca05ba1b964e42559365ff7fb5270b82c820a9 | |
parent | 18cf34d4701f86f5c8951ae0d340824b4b4f19ac (diff) | |
download | mediagoblin-37af09a2e51394c630bf7efd1718b77a574b272d.tar.lz mediagoblin-37af09a2e51394c630bf7efd1718b77a574b272d.tar.xz mediagoblin-37af09a2e51394c630bf7efd1718b77a574b272d.zip |
Require that the slug field have only unique values.
-rw-r--r-- | mediagoblin/models.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 |