Additional schema fields for Zope 3
Project description
Zaehlwerk Fields
Color field
Email field
Color Field
The string contained in the field describes a RGB color in hexdecimal format. Let’s first generate a color field:
>>> from zw.schema.color import Color >>> color = Color()
Make sure the colors validate:
>>> color.validate('aa00cc') >>> color.validate('00aa000') Traceback (most recent call last): ... InvalidColor: 00aa000
Email Field
The string contained in the field describes an email address. Let’s first generate a email field:
>>> from zw.schema.email import Email >>> email = Email()
Make sure the emails validate:
>>> email.validate('giesen@zaehlwerk.net') >>> email.validate('invalidzw') Traceback (most recent call last): ... InvalidEmail: invalidzw >>> email.validate('inva@zw') Traceback (most recent call last): ... InvalidEmail: inva@zw
CHANGES
Version 0.2 (2008-04-11)
Added email field
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zw.schema-0.2.tar.gz
(3.6 kB
view hashes)