A proper flexible python form library
Project description
Proper Forms is a flexible form library to make far easier to create beautiful, semantically rich, syntactically awesome, readily stylable and wonderfully accessible HTML forms in your Python web application.
Documentation: https://proper-forms.scaletti.dev
pip install proper-forms
How Proper Forms is different
-
A field isn't tied to a specific HTML tag, so can be presentend in multiple ways. Even the same form can be used in different contexts and have different widgets and styles on each.
-
Many commonly used built-in validators, and you can also write simple functions to use as custom ones.
-
Any field can accept multiple values; as a list or as a comma-separated text.
-
All error messages are customizable. The tone of the messages must be able to change or to be translated.
-
Incredible easy to integrate with any ORM (object-relational mapper).
Just show me how it looks
from proper_forms import Form, Email, Text
class CommentForm(Form):
email = Email(required=True, check_dns=True)
message = Text(
LongerThan(5, "Please write a longer message"),
required=True
)
def comment():
form = CommentForm(request.POST)
if request.method == "POST" and form.validate():
data = form.save()
...
return render_template("comment.html", form=form)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for proper_forms-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b6eac120c99f7899297b27dc5ef109359be2c1cf6e35712b45e6c0d4bc46fe7 |
|
MD5 | 457716e2146dedef979b60853f29c9e2 |
|
BLAKE2b-256 | 8b98cef4081f39150864f936bd74e7afa817e6315b93d2c195c2849b4c1ce078 |