Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
Important steps:
* include 'validation_extended' in yours INSTALLED_APPS
* read docstrings from validation_extended.validation


Package features:
- Turns form validation represent like so:
    # forms.py
    from validation_extended import AutoValidated

    class SomeForm(AutoValidated, django.forms.ModelForm):  # or django.forms.Form as base class
        class Meta:
            model = SomeModel

        class Validators:
            class RequiresAll:
                foo = [foo_validator]
            bar = [bar_validator]
            baz = [baz_validator(5)]

- Forms can make rules for jquery.validate if form class was inherited from ClientValidation
and all validators were inherited from Validator class and written like so:
    # validators.py
    from validation_extended import Validator

    class SimpleValidator(Validator):
        message = "simple validator error"
        client_events = "focusout keyup"
        data = {'values': [1, 2, 3]}

        def js_rules(self):
            pass

        def validated(self, field_name, data):
            if not data in self.data['values']:
                self.raise_error()

- It also provide remote validation. To use it include next lines in your urls.py:
    # urls.py
    urlpatterns += patterns(
        url(r'^validation/', include('validation_extended.urls')))

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.