Skip to content

Commit

Permalink
Change version & doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alfred82santa committed Mar 15, 2016
1 parent 1cb28de commit 03a9c83
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dirtymodels@0.3.6
dirtymodels@0.6.0
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: python
python:
- "3.3"
- "3.4"
- "3.5"
# command to install dependencies
install:
- pip install -r requirements-test.txt
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ help:
@echo "clean: Clean compiled files"
@echo "flake: Run Flake8"
@echo "prepush: Helper to run before to push to repo"
@echo "autopep: Reformat code using PEP8"
@echo "---------------------------------------------------------------"

requirements:
Expand Down Expand Up @@ -45,6 +46,9 @@ flake:
flake8 dirty_models
flake8 tests

autopep:
autopep8 --max-line-length 120 -r -j 8 -i .

prepush:
@make flake
@make run-tests
Expand Down
96 changes: 41 additions & 55 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,61 @@ Features
- Automatic cast value.
- Easy import from/export to dict.
- Basic field type implemented.
- Multi type fields.
- Default values for each field or whole model.
- HashMap model. It could be used instead of DynamicModel.
- FastDynamicModel. It could be used instead of DynamicModel. Same behavior, better performance.
- Pickable models.
- Datetime fields can use any datetime format using parser and formatter functions.
- No database dependent.
- Auto documentation using https://github.com/alfred82santa/dirty-models-sphinx
- Opensource (BSD License)

*********
Changelog
*********

Version 0.6.0
-------------

- Added default value for fields.

.. code-block:: python

class ExampleModel(BaseModel):
integer_field = IntegerField(default=1)

model = ExampleModel()
assert model.integer_field is 1

- Added default values at model level. Inherit default values could be override on new model classes.

.. code-block:: python

class InheritExampleModel(ExampleModel):
_default_data = {'integer_field': 2}

model = InheritExampleModel()
assert model.integer_field is 2

- Added multi type fields.

.. code-block:: python

class ExampleModel(BaseModel):
multi_field = MultiTypeField(field_types=[IntegerField(), StringField()])

model = ExampleModel()
model.multi_field = 2
assert model.multi_field is 2

model.multi_field = 'foo'
assert model.multi_field is 'foo'

Version 0.5.2
-------------

- Fix model structure.
- Fixex model structure.
- Makefile helpers.


Expand Down Expand Up @@ -155,57 +195,3 @@ Basic usage
.. note::

Look at tests for more examples


*****************
Performance Tests
*****************

.. code-block:: bash

$ python3 performancerunner.py
DynamicModel start
DynamicModel: iteration no. 0 start
DynamicModel: iteration no. 0 => 0:00:02.528166
DynamicModel: iteration no. 1 start
DynamicModel: iteration no. 1 => 0:00:03.415274
DynamicModel: iteration no. 2 start
DynamicModel: iteration no. 2 => 0:00:03.115128
DynamicModel: iteration no. 3 start
DynamicModel: iteration no. 3 => 0:00:04.091488
DynamicModel: iteration no. 4 start
DynamicModel: iteration no. 4 => 0:00:05.275302
DynamicModel => 0:00:18.425358
FastDynamicModel start
FastDynamicModel: iteration no. 0 start
FastDynamicModel: iteration no. 0 => 0:00:01.351796
FastDynamicModel: iteration no. 1 start
FastDynamicModel: iteration no. 1 => 0:00:01.265681
FastDynamicModel: iteration no. 2 start
FastDynamicModel: iteration no. 2 => 0:00:01.270142
FastDynamicModel: iteration no. 3 start
FastDynamicModel: iteration no. 3 => 0:00:01.273443
FastDynamicModel: iteration no. 4 start
FastDynamicModel: iteration no. 4 => 0:00:01.280512
FastDynamicModel => 0:00:06.441574
BlobField start
BlobField: iteration no. 0 start
BlobField: iteration no. 0 => 0:00:00.000082
BlobField: iteration no. 1 start
BlobField: iteration no. 1 => 0:00:00.000027
BlobField: iteration no. 2 start
BlobField: iteration no. 2 => 0:00:00.000025
BlobField: iteration no. 3 start
BlobField: iteration no. 3 => 0:00:00.000024
BlobField: iteration no. 4 start
BlobField: iteration no. 4 => 0:00:00.000023
BlobField => 0:00:00.000181
{'DynamicModel': {'results': [datetime.timedelta(0, 2, 528166), datetime.timedelta(0, 3, 415274),
datetime.timedelta(0, 3, 115128), datetime.timedelta(0, 4, 91488), datetime.timedelta(0, 5, 275302)],
'total': datetime.timedelta(0, 18, 425358)}, 'FastDynamicModel': {'results': [datetime.timedelta(0, 1, 351796),
datetime.timedelta(0, 1, 265681), datetime.timedelta(0, 1, 270142), datetime.timedelta(0, 1, 273443),
datetime.timedelta(0, 1, 280512)], 'total': datetime.timedelta(0, 6, 441574)}, 'BlobField':
{'results': [datetime.timedelta(0, 0, 82), datetime.timedelta(0, 0, 27), datetime.timedelta(0, 0, 25),
datetime.timedelta(0, 0, 24), datetime.timedelta(0, 0, 23)], 'total': datetime.timedelta(0, 0, 181)}}


3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
name='dirty-models',
url='https://github.com/alfred82santa/dirty-models',
author='alfred82santa',
version='0.5.2',
version='0.6.0',
author_email='[email protected]',
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'License :: OSI Approved :: BSD License',
'Development Status :: 4 - Beta'],
packages=['dirty_models'],
Expand Down

0 comments on commit 03a9c83

Please sign in to comment.