guillotina.schema

class guillotina.schema.Bool(title='', description='', __name__='', required=True, readonly=False, constraint=None, default=None, defaultFactory=None, missing_value=<object object>, **kw)

A field representing a Bool.

from_unicode(str)
>>> b = Bool()
>>> IFromUnicode.providedBy(b)
True
>>> b.from_unicode('True')
True
>>> b.from_unicode('')
False
>>> b.from_unicode('true')
True
>>> b.from_unicode('false') or b.from_unicode('False')
False
class guillotina.schema.Bytes(min_length=0, max_length=None, **kw)

Field containing a byte string (like the python str).

The value might be constrained to be with length limits.

from_unicode(uc)

See IFromUnicode.

class guillotina.schema.Choice(values=None, vocabulary=None, source=None, **kw)

Choice fields can have a value found in a constant or dynamic set of values given by the field definition.

bind(object)

See guillotina.schema._bootstrapinterfaces.IField.

from_unicode(str)

See IFromUnicode.

class guillotina.schema.Date(min=None, max=None, default=None, **kw)

Field containing a date.

class guillotina.schema.Datetime(*args, **kw)

Field containing a DateTime.

class guillotina.schema.Decimal(*args, **kw)

Field containing a Decimal.

from_unicode(uc)

See IFromUnicode.

class guillotina.schema.Dict(key_type=None, value_type=None, **kw)

A field representing a Dict.

bind(object)

See guillotina.schema._bootstrapinterfaces.IField.

class guillotina.schema.Float(*args, **kw)

Field containing a Float.

from_unicode(uc)

See IFromUnicode.

class guillotina.schema.Int(*args, **kw)

A field representing an Integer.

from_unicode(str)
>>> f = Int()
>>> f.from_unicode("125")
125
>>> f.from_unicode("125.6") #doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
...
ValueError: invalid literal for int(): 125.6
class guillotina.schema.JSONField(schema='{"type": "object", "properties": {}}', **kw)
class guillotina.schema.List(value_type=None, unique=False, **kw)

A field representing a List.

class guillotina.schema.Set(**kw)

A field representing a set.

class guillotina.schema.Text(*args, **kw)

A field containing text used for human discourse.

from_unicode(str)
>>> t = Text(constraint=lambda v: 'x' in v)
>>> t.from_unicode(b"foo x spam")
Traceback (most recent call last):
...
WrongType: ('foo x spam', <type 'unicode'>, '')
>>> t.from_unicode("foo x spam")
u'foo x spam'
>>> t.from_unicode("foo spam")
Traceback (most recent call last):
...
ConstraintNotSatisfied: ('foo spam', '')
class guillotina.schema.TextLine(*args, **kw)

A text field with no newlines.

class guillotina.schema.Time(min=None, max=None, default=None, **kw)

Field containing a time.

class guillotina.fields.PatchField(field, *args, **kwargs)
class guillotina.fields.BucketListField(*args, value_type=None, bucket_len=5000, **kwargs)
class guillotina.fields.CloudFileField(**kw)

A cloud file hosted file.

Its configured on config.json with :

“cloud_storage”: “guillotina.interfaces.IS3FileField”

or

“cloud_storage”: “guillotina_gcloudstorage.interfaces.IGCloudFileField”