def serialize_ttw_schema(schema=None): if not schema: schema = get_ttw_edited_schema() bfields = [a for a in IUserDataSchema] attrs = {} for name in schema: f = schema[name] if is_serialisable_field(f) and name not in bfields: attrs[name] = f smember = SchemaClass(SCHEMATA_KEY, attrs=attrs) finalizeSchemas(smember) model = Model({SCHEMATA_KEY: smember}) sschema = serialize(model) return sschema
def serializeModel(model): return serializer.serialize(model)