Name: django-saber
Owner: Futurice
Description: null
Created: 2015-10-09 11:54:05.0
Updated: 2017-06-07 07:45:18.0
Pushed: 2016-06-16 07:36:58.0
Homepage: null
Size: 19
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Saber provides a drop-in replacement for the Django ORM for dealing with a defined database set. All Model attributes, methods and relations will work seamlessly – faster.
This library helped reduce the generation of an expensive report from 200 seconds to 1 second, by changing a prefetched queryset with an in-memory data representation.
Your Django project should separate concerns; that is, separate Models (fields) and Controllers (logic). This allows Saber to use the same logic.
s ThinController(object):
name_rhymes_with_orange(self): pass
s Thin(ThinController, models.Model):
e = models.CharField(max_length=255)
To mimic Models, provide the module that has the model Controllers. By default, memory.initialize() will load the full database into memory.
ry = Memory(controllers=['test_project.controllers'])
ry.initialize()
base = Traverse(memory.data)
base.thin.all()
base.thin[0].name
base.thin[0].name_rhymes_with_orange()
BSD-3 see LICENSE