Beispiel #1
0
    def clean_name(self):

        name = self.cleaned_data['name']
        project = self.cleaned_data['project']

        # make sure name is unique with the project
        try:
            n = Folder.objects.filter(project=project).get(name__iexact=name)
            raise forms.ValidationError("The folder name: %s already exists, please try again. "
                                        % n.name)
        except Folder.DoesNotExist:
            pass

        # looks for invalid characters
        name = default_clean_field(self, 'name')

        return name
Beispiel #2
0
 def clean_description(self):
     return default_clean_field(self, 'description')
Beispiel #3
0
 def clean_name(self):
     return default_clean_field(self, 'name')
Beispiel #4
0
 def clean_name(self):
     return default_clean_field(self, 'name')
Beispiel #5
0
 def clean_label(self):
     return default_clean_field(self, 'label')
Beispiel #6
0
 def clean_key(self):
     return default_clean_field(self, 'key')