The tacker.api.v1.resource Module

Utility methods for working with WSGI servers redux

class tacker.api.v1.resource.Request(environ, charset=None, unicode_errors=None, decode_param_names=None, **kw)

Bases: tacker.wsgi.Request

tacker.api.v1.resource.Resource(controller, faults=None, deserializers=None, serializers=None)

API entity resource.

Represents an API entity resource and the associated serialization and deserialization logic

tacker.api.v1.resource.translate(translatable, locale)

Translates the object to the given locale.

If the object is an exception its translatable elements are translated in place, if the object is a translatable string it is translated and returned. Otherwise, the object is returned as-is.

Parameters:
  • translatable – the object to be translated
  • locale – the locale to translate to
Returns:

the translated object, or the object as-is if it was not translated