serializers Module

This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)

gluon.serializers.cast_keys(o, cast=<type 'str'>, encoding='utf-8')[source]

Builds a new object with <cast> type keys. Use this function if you are in Python < 2.6.5 This avoids syntax errors when unpacking dictionary arguments.

Parameters:
  • o – is the object input
  • cast

    (defaults to str) is an object type or function which supports conversion such as:

    converted = cast(o)
  • encoding – (defaults to utf-8) is the encoding for unicode keys. This is not used for custom cast functions
gluon.serializers.csv(value)[source]
gluon.serializers.custom_json(o)[source]
gluon.serializers.ics(events, title=None, link=None, timeshift=0, calname=True, **ignored)[source]
gluon.serializers.json(value, default=<function custom_json>)[source]
gluon.serializers.loads_json(o, unicode_keys=True, **kwargs)[source]
gluon.serializers.loads_yaml(data)[source]
gluon.serializers.rss(feed)[source]
gluon.serializers.safe_encode(text)[source]
gluon.serializers.xml(value, encoding='UTF-8', key='document', quote=True)[source]
gluon.serializers.xml_rec(value, key, quote=True)[source]
gluon.serializers.yaml(data)[source]