]> git.parisson.com Git - telemeta.git/commitdiff
update item and collection regex for the CREM, now ignore media.py against telemeta...
authoryomguy <yomguy@parisson.com>
Mon, 16 May 2011 17:09:02 +0000 (19:09 +0200)
committeryomguy <yomguy@parisson.com>
Mon, 16 May 2011 17:09:02 +0000 (19:09 +0200)
.bzrignore [new file with mode: 0644]
telemeta/models/media.py

diff --git a/.bzrignore b/.bzrignore
new file mode 100644 (file)
index 0000000..69213d7
--- /dev/null
@@ -0,0 +1 @@
+telemeta/models/media.py
index 4138c06812c91f6645cefa0ce85eb55c05f04a8b..9df6013102b627d865b828e27513577e6be54610 100644 (file)
@@ -72,8 +72,8 @@ class MediaResource(ModelCore):
         abstract = True
 
 
-collection_published_code_regex   = '[A-Za-z0-9._-]*'
-collection_unpublished_code_regex = '[A-Za-z0-9._-]*'
+collection_published_code_regex   = 'CNRSMH_E_[0-9]{4}(?:_[0-9]{3}){2}'
+collection_unpublished_code_regex = 'CNRSMH_I_[0-9]{4}_[0-9]{3}'
 collection_code_regex             = '(?:%s|%s)' % (collection_published_code_regex, 
                                                     collection_unpublished_code_regex)
                                                         
@@ -214,8 +214,8 @@ class MediaCollectionForm(ModelForm):
         model = MediaCollection
 
 
-item_published_code_regex    = '[A-Za-z0-9._-]*'
-item_unpublished_code_regex  = '[A-Za-z0-9._-]*'
+item_published_code_regex    = collection_published_code_regex + '(?:_[0-9]{2}){1,2}'
+item_unpublished_code_regex  = collection_unpublished_code_regex + '_[0-9]{2,3}(?:_[0-9]{2}){0,2}'
 item_code_regex              = '(?:%s|%s)' % (item_published_code_regex, item_unpublished_code_regex)
 
 class MediaItem(MediaResource):