The nova.openstack.common.report.models.base Module

Provides the base report model

This module defines a class representing the basic report data model from which all data models should inherit (or at least implement similar functionality). Data models store unserialized data generated by generators during the report serialization process.

class ReportModel(data=None, attached_view=None)

Bases: _abcoll.MutableMapping

A Report Data Model

A report data model contains data generated by some generator method or class. Data may be read or written using dictionary-style access, and may be read (but not written) using object-member-style access. Additionally, a data model may have an associated view. This view is used to serialize the model when str() is called on the model. An appropriate object for a view is callable with a single parameter: the model to be serialized.

Parameters:
  • data – a dictionary of data to initially associate with the model
  • attached_view – a view object to attach to this model
set_current_view_type(tp)

Set the current view type

This method attempts to set the current view type for this model and all submodels by calling itself recursively on all values (and ignoring the ones that are not themselves models)

Parameters:tp – the type of the view (‘text’, ‘json’, ‘xml’, etc)

Previous topic

The nova.openstack.common.report.guru_meditation_report Module

Next topic

The nova.openstack.common.report.models.conf Module

This Page