Module Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore ListLoad Str Str Str Str Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Dict If CompareLt AttributeLoad NameLoad attr TupleLoad Num Num body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr decorator_list orelse FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str If CompareIn NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Return Call NameLoad NameLoad orelse Raise Call NameLoad Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Return Call NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Dict Assign NameStore TupleLoad FunctionDef arguments args NameParam defaults kwarg body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr GeneratorExp TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad CompareIn NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr ListLoad Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Raise NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore TupleLoad Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If NameLoad body Return Dict Str Str Str Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign NameStore BoolOpOr NameLoad Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr With Call AttributeLoad NameLoad attr keyword NameLoad NameStore body For NameStore SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Dict Str Str FunctionDef arguments args NameParam NameParam defaults body If AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore NameLoad Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr GeneratorExp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr CompareIn AttributeLoad NameLoad attr NameLoad Assign NameStore Dict Str Str Str NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign NameStore BoolOpOr NameLoad Call NameLoad If AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Str Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr Expr Call NameLoad NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr With Call AttributeLoad Call AttributeLoad NameLoad attr attr NameStore body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list decorator_list Expr Call NameLoad Str NameLoad Expr Call NameLoad Str NameLoad
N/A N/A logging N/A json N/A sys N/A csv inspect isclass stdnet.utils StringIO globals get_model_from_hash N/A __all__ N/A get_serializer register_serializer unregister_serializer all_serializers Serializer JsonSerializer N/A LOGGER N/A N/A logging getLogger stdnet.odm N/A _serializers N/A N/A N/A N/A sys version_info N/A 2 7 N/A writeheader N/A N/A dw N/A N/A N/A N/A N/A dw writerow N/A dict N/A N/A k k N/A k N/A dw fieldnames N/A N/A writeheader N/A N/A dw N/A N/A N/A N/A N/A dw writeheader N/A get_serializer N/A N/A name N/A options N/A N/A Retrieve a serializer register as *name*. If the serializer is not
available a ``ValueError`` exception will raise.
A common usage pattern::

    qs = MyModel.objects.query().sort_by('id')
    s = odm.get_serializer('json')
    s.dump(qs)
 N/A N/A name _serializers N/A N/A serializer N/A _serializers N/A name N/A N/A serializer options N/A N/A N/A ValueError N/A N/A Unknown serializer {0}. format name N/A register_serializer N/A N/A name serializer N/A N/A N/A Register a new serializer to the library.

:parameter name: serializer name (it can override existing serializers).
:parameter serializer: an instance or a derived class of a
    :class:`stdnet.odm.Serializer` class or a callable.
 N/A N/A N/A isclass serializer N/A N/A serializer N/A serializer __class__ N/A N/A _serializers N/A name serializer N/A unregister_serializer N/A N/A name N/A N/A N/A N/A N/A _serializers pop name None N/A all_serializers N/A N/A N/A N/A N/A N/A sorted _serializers N/A Serializer N/A object N/A N/A The stdnet serializer base class. During initialization, the *options*
dictionary is used to override the :attr:`default_options`. These are specific
to each :class:`Serializer` implementation.

.. attribute:: default_options

    Dictionary of default options which are overwritten during initialisation.
    By default it is an empty dictionary.

.. attribute:: options

    Dictionary of options.
 N/A default_options N/A N/A arguments N/A __init__ N/A N/A self N/A options N/A N/A opts N/A N/A N/A self default_options copy N/A N/A N/A opts update N/A N/A v N/A options N/A v N/A v options N/A v N/A self arguments N/A N/A self options opts N/A data N/A N/A self N/A N/A N/A CList of data to dump into a stream. N/A N/A N/A hasattr self _data N/A N/A N/A self _data N/A N/A N/A self _data N/A property dump N/A N/A self qs N/A N/A N/A Add a :class:`Query` ``qs`` into the collection of :attr:`data`
to dump into a stream. No writing is done until the :meth:`write` method. N/A NotImplementedError N/A write N/A N/A self stream N/A None N/A N/A Write the serialized data into a stream. If *stream* is not
provided, a python ``StringIO`` is used.

:return: the stream object. N/A NotImplementedError N/A load N/A N/A self models stream model N/A None N/A N/A Load a stream of data into the database.

:param models: the :class:`Router` which must contains all the model this
    method will load.
:param stream: bytes or an object with a ``read`` method returning bytes.
:param model: Optional :class:`StdModel` we need to load. If not provided all
    models in ``stream`` are loaded.

This method must be implemented by subclasses.
 N/A NotImplementedError N/A N/A JsonSerializer N/A Serializer N/A N/A The default :class:`Serializer` of :mod:`stdnet`. It
serialise/unserialise models into json data. It has one option given
by the *indent* of the ``json`` string for pretty serialisation. N/A arguments N/A indent get_data N/A N/A self qs N/A N/A N/A data N/A N/A obj qs N/A N/A N/A N/A data append N/A N/A obj tojson N/A meta N/A obj _meta N/A data N/A N/A N/A model hash data N/A str meta N/A meta hash data N/A dump N/A N/A self qs N/A N/A N/A data N/A N/A self get_data qs N/A data N/A N/A N/A N/A N/A self data append data N/A write N/A N/A self stream N/A None N/A N/A stream N/A stream N/A StringIO N/A line N/A N/A json dumps N/A self data stream N/A self options N/A N/A N/A stream write line N/A stream N/A load N/A N/A self models stream model N/A None N/A N/A N/A hasattr stream read N/A N/A stream N/A N/A stream read N/A data N/A N/A json loads stream N/A self options N/A model_data data N/A N/A model N/A get_model_from_hash N/A model_data N/A hash N/A model N/A N/A model N/A N/A self on_load_model model model_data N/A model N/A N/A manager N/A models N/A model N/A N/A N/A LOGGER info Loading model %s N/A model _meta N/A session N/A N/A manager session N/A N/A N/A session begin signal_commit False t N/A N/A item_data N/A model_data N/A data N/A N/A N/A N/A t add N/A N/A model from_base64_data item_data N/A N/A N/A N/A LOGGER error Could not load model %s N/A N/A model_data get model N/A N/A N/A self on_finished_load N/A on_load_model N/A N/A self model model_data N/A N/A N/A Callback when a *model* is about to be loaded. If it returns the
model, the model will get loaded otherwise it will skip the loading. N/A model N/A on_finished_load N/A N/A self N/A N/A N/A Callback when loading of data is finished N/A N/A N/A CsvSerializer N/A Serializer N/A N/A A csv serializer for single model. It serialize/unserialize a model
query into a csv file. N/A default_options N/A lineterminator dump N/A N/A self qs N/A N/A N/A N/A self data N/A N/A N/A ValueError Cannot serialize more than one model into CSV N/A fields None N/A data N/A N/A obj qs N/A N/A js N/A N/A obj tojson N/A N/A fields None N/A N/A fields N/A set js N/A N/A N/A N/A fields update js N/A N/A N/A data append js N/A meta N/A obj _meta N/A ordered_fields N/A N/A N/A meta pkname N/A N/A N/A ordered_fields extend N/A N/A f name N/A f N/A meta scalarfields N/A N/A f name fields N/A data N/A fieldnames hash data ordered_fields N/A meta hash data N/A N/A N/A N/A self data append data N/A write N/A N/A self stream N/A None N/A N/A stream N/A stream N/A StringIO N/A N/A self data N/A N/A fieldnames N/A N/A N/A self data N/A 0 N/A fieldnames N/A data N/A N/A N/A self data N/A 0 N/A data N/A data N/A N/A w N/A N/A csv DictWriter stream fieldnames N/A self options N/A N/A writeheader w N/A row data N/A N/A N/A N/A w writerow row N/A stream N/A load N/A N/A self models stream model N/A None N/A N/A N/A model N/A N/A N/A ValueError Model is required when loading from csv file N/A r N/A N/A csv DictReader stream N/A self options N/A N/A N/A N/A N/A models session begin t N/A N/A item_data r N/A N/A N/A N/A t add N/A N/A model from_base64_data item_data N/A N/A t on_result N/A N/A N/A N/A register_serializer json JsonSerializer N/A N/A register_serializer csv CsvSerializer