Skip to main content

WTForms for Mongoengine documents

Project description

WTFMongoengine creates WTForms Form classes from Mongoengine Document objects. Example:

from mongoengine import document, fields
from wtfmongoengine.forms import DocumentForm

class User(document.Document):
    first_name = fields.StringField(
        verbose_name='First name',
        max_length=50,
        required=True,
    )
    last_name = fields.StringField(
        verbose_name='Last name',
        max_length=50,
        required=False,
    )
    email = fields.EmailField(
        verbose_name='E-mail address',
        required=True,
    )

class UserForm(DocumentForm):
    class Meta:
        document_class = User

        # In case you only want to include ``first_name`` in the form
        # fields = ('first_name',)

        # In case you want to exclude ``email`` from the form
        # exclude = ('email',)

Changelog

0.1.2

  • Dependency fix (wtforms was in tests_require, needed to be in install_requires).

0.1.1

  • Example updates.

  • Fix: README.rst and LICENSE included in package.

0.1

  • Initial release.

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

WTFMongoengine-0.1.2.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file WTFMongoengine-0.1.2.tar.gz.

File metadata

File hashes

Hashes for WTFMongoengine-0.1.2.tar.gz
Algorithm Hash digest
SHA256 18e31df369c6072ff998448e9188eca1923f8914191c12b25a79d6988aa87df8
MD5 678af591d972bf83da0d0d66dc5d25f2
BLAKE2b-256 c4fb24b7686cfaac5d0184f8e1bc76620193717e492ee9e29f02df1fd00e7ea8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page