layrz-forms
Validate forms may be a complex task, especially when you have nested data. layrz-forms
solves that problem by providing a simple way to validate forms in Django. Replaces the default Django forms with a more flexible and easier to use library.
The definition of the form is similar to the default Django forms, but with a more flexible and easier to use approach:
python
from layrz import forms
class SubformForm(forms.Form):
name = forms.CharField(required=True, empty=False, min_length=5, max_length=10)
class MyForm(forms.Form):
name = forms.CharField(required=True, empty=False, min_length=5, max_length=10)
# This is the improvement, what happens if you have a nested form?
subform = SubformForm()
# Is as simple as that, but, if we need a list of subforms?
subforms = [SubformForm()]
# And, that's it!
For more information, checkout the README
file on GitHub.
Where can I get the library?
You can get the library from pypi.org.
Can I contribute to the library?
Of course! Feel free to contribute to the library on GitHub.
Where are the source code?
You can find the source code on GitHub.