The oslo_reports.models.with_default_views Module

class oslo_reports.models.with_default_views.ModelWithDefaultViews(*args, **kwargs)

Bases: oslo_reports.models.base.ReportModel

A Model With Default Views of Various Types

A model with default views has several predefined views, each associated with a given type. This is often used for when a submodel should have an attached view, but the view differs depending on the serialization format

Parameters are as the superclass, except for any parameters ending in ‘_view’: these parameters get stored as default views.

The default ‘default views’ are

text
oslo_reports.views.text.generic.KeyValueView
xml
oslo_reports.views.xml.generic.KeyValueView
json
oslo_reports.views.json.generic.KeyValueView
to_type()

(‘type’ is one of the ‘default views’ defined for this model) Serializes this model using the default view for ‘type’

Return type:str
Returns:this model serialized as ‘type’
set_current_view_type(tp, visited=None)