Releases: AFriemann/simple_model
Releases · AFriemann/simple_model
modified v2 due to shared memory issues
list_type now working with v2 Model stacking
For v2 Models list_type could not be used to stack Models:
@Model()
@Attribute('stacked', type=list_type(OtherModel))
class MyModel(object):
pass
this should now be solved.
v2 draft included
Included the new draft for version 2, take a look at README.v2.rst for examples.
from simple_models.v2 import Model, Attribute
@Model()
@Attribute('foobar', type=int)
class MyModel(object):
pass
fixed the version mess
I sheepishly f**** up the package version. Should be fixed now :/
Can now set arbitrary Model attributes
It should now be possible to set Model attributes after initialization:
class Foo(Model):
a = Attribute(str)
@property
def x(self):
return self.__x__
@x.setter
def x(self, value):
self.__x__ = value
should now work
changed Model logger
Changed Model logger to run as simple_model.${MODEL_NAME}.
This will allow easier control of simple_model logs, since you can now simply run
>>> import logging
>>> logging.getLogger('simple_model').setLevel(logging.WARNING)
model mutability
It is now possible to correctly modify Attributes after creating a Model instance.
To avoid that behaviour, you can set Model.mutable to False.
fixed problem with falsy attribute values
1.1.1 fixed problem where Falsy values would be dropped when parsing kwargs
disallow ignore unknown values
Can now set the class Attribute ignore_unknown in the Model to False to disallow unknown keywords. Unknowns will result in a ValueError.
helper methods moved
- moved list_type helper class to separate file
- added one_of function for easy value checking