[Oi-commits] r2573 - trunk/ideas

oi-svn at pardus.org.tr oi-svn at pardus.org.tr
Sat May 30 17:56:27 EEST 2009


Author: jnmbk
Date: Sat May 30 17:56:27 2009
New Revision: 2573

Modified:
   trunk/ideas/forms.py
Log:
5 tag limit in ideas

Modified: trunk/ideas/forms.py
=================================================================
--- trunk/ideas/forms.py	(original)
+++ trunk/ideas/forms.py	Sat May 30 17:56:27 2009
@@ -13,6 +13,12 @@
         model = Idea
         exclude = ('file',"submitter", "status", "vote_count", "duplicate", "is_hidden", "is_duplicate", "comment_count", "topic")
 
+    def clean_tags(self):
+        field_data = self.cleaned_data['tags']
+        if len(field_data) > 5:
+            raise forms.ValidationError("En fazla 5 etiket seçebilirsiniz. Lütfen açtığınız başlığa uygun etiket seçiniz.")
+        return field_data
+
 #    def __init__(self,*args,**kwargs):
 #        super(NewIdeaForm, self).__init__(*args, **kwargs)
 #        related_categories = RelatedCategory.objects.all()


More information about the Oi-commits mailing list