Ejemplo n.º 1
0
class GenericSlotsObjectModel(with_metaclass(ObjectModelSlotsMetaclass, _PrototypeSlotsObjectModel)):
    """ Standard slots-based model

    all_fields - tuple of all fields names
    optional_fields - tuple of optional (not required fields names)
    default_values - dict of default values for fields (if value not received in init)
    fields_types - dict of all fields types
    """
    all_fields = tuple()
    optional_fields = tuple()
    default_values = dict()
    fields_types = dict()
Ejemplo n.º 2
0
class SlotsObjectModelKwargs(with_metaclass(PrettyObjectModelSlotsMetaclass, _PrototypeSlotsObjectModel)):
    """ Pretty slots-based object model with keyword args in constructor"""
    __slots__ = tuple()

    def __init__(self, **data):
        self.init_model(data)
Ejemplo n.º 3
0
class SlotsObjectModel(with_metaclass(PrettyObjectModelSlotsMetaclass, _PrototypeSlotsObjectModel)):
    """ Pretty slots-based object model """
    __slots__ = tuple()

    def __init__(self, data):
        self.init_model(data)
Ejemplo n.º 4
0
class ObjectModel(
        with_metaclass(PrettyObjectModelDictMetaclass,
                       _PrototypeDictObjectModel)):
    """ Pretty object model """
    def __init__(self, data):
        self.init_model(data)