Skip to content

Instantly share code, notes, and snippets.

@mnuck
Created March 8, 2012 05:15
Show Gist options
  • Save mnuck/1998863 to your computer and use it in GitHub Desktop.
Save mnuck/1998863 to your computer and use it in GitHub Desktop.
from tater.models import FakeGlobal
class needsScriptingQueue(object):
def __init__(self, f):
self.f = f
self.__name__ = f.__name__
def __call__(self, *args):
global scriptingQueue
sq_db = FakeGlobal.objects.get(name='scriptingQueue')
scriptingQueue = json.loads(sq_db.value)
retval = self.f(*args)
sq_db.value = json.dumps(scriptingQueue)
sq_db.save()
del scriptingQueue
return retval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment