File: //lib/python2.7/site-packages/leapp/models/__init__.pyc
�
g��fc @ s' d Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l
m Z m Z m
Z
d d l m Z m Z d e f d
� � YZ d e e � f d � � YZ d
e f d � � YZ d e f d � � YZ d � Z d e f d � � YZ d � Z d � Z d � Z e � d S( sy Leapp Models
These packages provide an interface describing a message payload data structure in the form of Models.
Together with the :py:mod:`leapp.models.fields`, package models are defined.
Example::
class Boom(Model):
topic = SomeTopic
reason = fields.String()
class Foobar(Model):
topic = SomeTopic
baz = fields.List(fields.String(), default=[])
boom = fields.Model(Boom)
Now, the models can be used like this::
f = Foobar(boom=Boom())
f.boom.reason = "Example"
f.baz.append("Add a string value to the list")
from pprint import pprint
pprint(f.dump())
i����N( t ModelDefinitionError( t fields( t
ErrorSeverity( t ModelMisuseError( t DialogTopict
ErrorTopict Topic( t get_flattened_subclassest with_metaclasst ModelMetac B s e Z d Z d � Z d � Z RS( s�
ModelMeta is a metaclass used for Model
It verifies the validity of attributes and registers the model as a message type with the :py:class:`Topic`.
c
C s� t t | � j | | | | � } xD | D]<