|
OpenQuizz
Une application de gestion des contenus pédagogiques
|


Public Member Functions | |
| def | __init__ (self, dt_format="iso8601", **kwargs) |
| def | parse (self, value) |
| def | format (self, value) |
| def | format_rfc822 (self, dt) |
| def | format_iso8601 (self, dt) |
| def | schema (self) |
Public Member Functions inherited from MinMaxMixin | |
| def | __init__ (self, *args, **kwargs) |
Public Member Functions inherited from Raw | |
| def | __init__ (self, default=None, attribute=None, title=None, description=None, required=None, readonly=None, example=None, mask=None, **kwargs) |
| def | output (self, key, obj, **kwargs) |
| def | __schema__ (self) |
Data Fields | |
| dt_format | |
Data Fields inherited from MinMaxMixin | |
| minimum | |
| exclusiveMinimum | |
| maximum | |
| exclusiveMaximum | |
Data Fields inherited from Raw | |
| attribute | |
| default | |
| title | |
| description | |
| required | |
| readonly | |
| example | |
| mask | |
Return a formatted datetime string in UTC. Supported formats are RFC 822 and ISO 8601. See :func:`email.utils.formatdate` for more info on the RFC 822 format. See :meth:`datetime.datetime.isoformat` for more info on the ISO 8601 format. :param str dt_format: ``rfc822`` or ``iso8601``
| def __init__ | ( | self, | |
dt_format = "iso8601", |
|||
| ** | kwargs | ||
| ) |
| def format | ( | self, | |
| value | |||
| ) |
Formats a field's value. No-op by default - field classes that
modify how the value of existing object keys should be presented should
override this and apply the appropriate formatting.
:param value: The value to format
:raises MarshallingError: In case of formatting problem
Ex::
class TitleCase(Raw):
def format(self, value):
return unicode(value).title()
Reimplemented from Raw.
| def format_iso8601 | ( | self, | |
| dt | |||
| ) |
Turn a datetime object into an ISO8601 formatted date. :param datetime dt: The datetime to transform :return: A ISO 8601 formatted date string
| def format_rfc822 | ( | self, | |
| dt | |||
| ) |
Turn a datetime object into a formatted date. :param datetime dt: The datetime to transform :return: A RFC 822 formatted date string
| def parse | ( | self, | |
| value | |||
| ) |
Reimplemented in Date.
| def schema | ( | self | ) |
Reimplemented from Raw.
| dt_format |