Skip to content

Commit

Permalink
Performace test
Browse files Browse the repository at this point in the history
  • Loading branch information
alfred82santa committed Sep 15, 2014
1 parent 9694657 commit 63a4cc1
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions performance/fastdynamicmodel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'''
Created on 15/09/2014
:author: alfred
'''
from dirty_models.models import BaseModel, FastDynamicModel
from performance.dynamicmodel import create_dict
from dirty_models.fields import ModelField


class FakeDynModel(BaseModel):
fake_data = ModelField(model_class=FastDynamicModel)


class FastDynamicModelPerformance:

def __init__(self, depth=5, children_count=5):
self.depth = depth
self.children_count = children_count

def prepare(self):
self.data = create_dict(self.depth, self.children_count)

def run(self):
return FakeDynModel(data={'fake_data': self.data})

0 comments on commit 63a4cc1

Please sign in to comment.