예제 #1
0
파일: forms.py 프로젝트: andymckay/zamboni
 def clean_cat(self):
     # If request category is a tarako one, get the corresponding list of
     # slugs, otherwise just build a list with the slug requested.
     if self.cleaned_data['cat']:
         return TARAKO_CATEGORIES_MAPPING.get(self.cleaned_data['cat'],
                                              [self.cleaned_data['cat']])
     return None
예제 #2
0
파일: forms.py 프로젝트: j-barron/zamboni
 def clean_cat(self):
     # If request category is a tarako one, get the corresponding list of
     # slugs, otherwise just build a list with the slug requested.
     if self.cleaned_data['cat']:
         return TARAKO_CATEGORIES_MAPPING.get(self.cleaned_data['cat'],
                                              [self.cleaned_data['cat']])
     return None
예제 #3
0
파일: forms.py 프로젝트: Jobava/zamboni
 def clean_cat(self):
     # If request category is a tarako one, get the corresponding list of
     # slugs, otherwise just build a list with the slug requested.
     cat = self.cleaned_data['cat']
     if cat.startswith('tarako'):
         return TARAKO_CATEGORIES_MAPPING.get(cat, [cat])
     if cat in CATEGORY_REDIRECTS:
         return [CATEGORY_REDIRECTS[cat]]
     if cat:
         return [cat]
예제 #4
0
 def clean_cat(self):
     # If request category is a tarako one, get the corresponding list of
     # slugs, otherwise just build a list with the slug requested.
     cat = self.cleaned_data['cat']
     if cat.startswith('tarako'):
         return TARAKO_CATEGORIES_MAPPING.get(cat, [cat])
     if cat in CATEGORY_REDIRECTS:
         return [CATEGORY_REDIRECTS[cat]]
     if cat:
         return [cat]