candv stands for Constants & Values. It is a little Python library which provides an easy way for creating complex constants.
dive-in install usage customization misc
You can click a version name to see a diff with the previous one.
1.3.0 (Dec 31, 2014)
- Implement
to_primitive()
method, which can be used for serialization, for example, into JSON (#1). Seeusage<usage_exporting>
andcustomization<customization_exporting>
for more info.
- Implement
1.2.0 (Oct 11, 2014)
- Core classes were significantly refactored.
constant_class
uses~candv.base.Constant
as default value (instead ofNone
, seecustom_containers
for more info).- Support of groups was reimplemented: now they are classes just as other constants containers (earlier groups were instances of patched containers). So, groups automatically gain all those attributes and methods which usual containers have.
- Constant's
container
attribute was made public. Groups of constants now have it too (seehierarchies
). - API of containers was made really close to API of Python's
dict
(see usage <usage_simple_constants>
for more info):__getitem__
,__contains__
,__len__
and__iter__
magic methods were implemented;contains
method was renamed tohas_name
;get_by_name
method was removed in favor of__getitem__
method.get
method with support of default value was introduced.
- All objects (contaners, groups and constants) now have
name
andfull_name
attributes. This may be useful if you use names of constants as key values (e.g. for Redis). - Also, all objects have good
repr
now. - Mixin factory
~candv.base.with_constant_class
was introduced. It may help you to define more readable containers. - A potential bug of uninitialized unbounded constants was fixed. Unbounded constant is an instance of a class which is differ from container's
constant_class
or its subclasses. This is unnatural case, but if you really need it, it will not break now. - Exception messages are more informative now.
- Tests were moved out the package.
Introductory documentation <dive-in>
was improved. Other docs were updated too.
1.1.2 (Jul 6, 2014)
- add
values
anditervalues
attributes toConstantsContainer
.
- add
1.1.1 (Jun 21, 2014)
- switch license from
GPLv2
toLGPLv3
.
- switch license from
1.1.0 (Jun 21, 2014)
- remove
Choices
container, move it to django-candv-choices library; - update docs and fix typos;
- strip utils from requirements.
- remove
- 1.0.0 (Apr 15, 2014)
Initial version.
Feel free to explore, fork or contribute:
Alexander Oblovatniy (@oblalex) created candv
and these fine people have contributed.
modules
genindex
modindex
search