Convert database bootstrap setups from class based to database stored fixtures

This commit is contained in:
Roberto Rosario
2012-09-22 03:00:47 -04:00
parent 397c1ad86b
commit d48338a989
6 changed files with 104 additions and 3 deletions

18
apps/bootstrap/classes.py Normal file
View File

@@ -0,0 +1,18 @@
from __future__ import absolute_import
class Cleanup(object):
"""
Class to store all the registered cleanup functions in one place
"""
_registry = {}
@classmethod
def execute_all(cls):
for cleanup in cls._registry.values():
cleanup.function()
def __init__(self, name, function):
self.name = name
self.function = function
self.__class__._registry[self.name] = self