Skip to content

Instantly share code, notes, and snippets.

@reedobrien
Created August 11, 2011 21:17
Show Gist options
  • Save reedobrien/1140803 to your computer and use it in GitHub Desktop.
Save reedobrien/1140803 to your computer and use it in GitHub Desktop.
from colander import Email
from colander import Schema
from colander import SchemaNode
from colander import Sequence
from colander import SequenceSchema
from colander import String
from colander import Tuple
from colander import null
from limone_zodb import content_schema
#from zodb_auth import User
from tgc.security import DEFAULT_GROUPS
class Groups(SequenceSchema):
group = SchemaNode(Tuple(), missing=DEFAULT_GROUPS)
class User(Schema):
__acl__ = Groups(missing=())
display_name = SchemaNode(String(), missing=null)
email = SchemaNode(String(), validator=Email())
last_login = SchemaNode(String(),missing=null)
password_hmac = SchemaNode(String(),)
userid = SchemaNode(String(),)
@content_schema
class Vendor(User):
region = SchemaNode(String('UTF-8'))
category = SchemaNode(String('UTF-8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment