Example #1
0
    class S(halogen.Schema):

        """Test schema."""

        key = halogen.Attr()
Example #2
0
    class Schema(halogen.Schema):

        attr = halogen.Attr(required=True, default=lambda: 'lambda')
Example #3
0
class Ticket(halogen.Schema):
    """Test schema."""

    item = halogen.Attr(types.URI('static'), )
Example #4
0
    class T(S):

        """Test schema."""

        key = halogen.Attr()
Example #5
0
class Product(halogen.Schema):
    """A product has a name and quantity."""

    name = halogen.Attr()
    quantity = halogen.Attr()
Example #6
0
class AccountSchema(halogen.Schema):
    self = halogen.Link(attr=lambda account: url_for(
        "get_account", account_key=account.key.urlsafe()))
    id = halogen.Attr(attr=lambda account: account.key.id())
    username = halogen.Attr()
Example #7
0
 class Error(halogen.Schema):
     message = halogen.Attr(
         attr=lambda error, language: error["message"][language])
Example #8
0
class PersonSchema(halogen.Schema):
    """A schema that matches the Person class."""

    name = halogen.Attr()
    surname = halogen.Attr()
Example #9
0
class PublisherSchema(halogen.Schema):

    name = halogen.Attr(required=True)
    address = halogen.Attr()
Example #10
0
class BookSchema(halogen.Schema):

    title = halogen.Attr(required=True)
    year = halogen.Attr(halogen.types.Int(), required=True)
    authors = halogen.Attr(halogen.types.List(AuthorSchema), required=True)
    publisher = halogen.Attr(PublisherSchema)
Example #11
0
class AuthorSchema(halogen.Schema):

    name = halogen.Attr(required=True)
Example #12
0
class MySchema(halogen.Schema):
    """Test schema."""

    num = halogen.Attr(
        halogen.types.Int(
            validators=[halogen.validators.Range(min=10, max=11)]))
Example #13
0
class EventSchema(halogen.Schema):
    """A schema that matches the Event class."""

    name = halogen.Attr()
Example #14
0
    class Schema(halogen.Schema):

        attr = halogen.Attr(required=True)
Example #15
0
class Person(halogen.Schema):
    """A person has a name and surname."""

    name = halogen.Attr()
    surname = halogen.Attr()
Example #16
0
    class Schema(halogen.Schema):

        attr = halogen.Attr(required=False, default=1)
Example #17
0
 class OrderedSchema2(halogen.Schema):
     self = halogen.Link('http://somewhere.com')
     hello = halogen.Attr()
     foo = halogen.Attr('bar')
     person = halogen.Embedded(PersonSchema)