This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
inspired from http://www.knockmeout.net/2011/04/pausing-notifications-in-knockoutjs.html , with the following changes | |
1. Pause never causes trigger or computation | |
2. Resume only causes trigger if the computed dependencies were triggered while it was paused | |
3. Pause and Resume can be nested without any additional triggers or computation | |
### | |
ko.pauseableComputed = (evaluatorFunction, evaluatorTarget) -> | |
isPaused = ko.observable(false) | |
pauseCounter = ko.observable(0) | |
# Using this method ensures that when the counter goes from 1 to 2, the isPaused observable does not trigger again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from optparse import make_option | |
from os.path import dirname, join, abspath, basename | |
import shutil | |
import subprocess | |
from django.core.management.base import AppCommand | |
class Command(AppCommand): | |
help = "Reset south migrations for app" | |
option_list = AppCommand.option_list + ( | |
make_option('--soft', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.cache import BaseCache | |
from django.core.cache import get_cache | |
from lock_factory import LockFactory | |
class ChainedCache(BaseCache): | |
def __init__(self, name, params): | |
BaseCache.__init__(self, params) | |
self.caches = [get_cache(cache_name) for cache_name in params.get('CACHES', [])] | |
self.debug = params.get('DEBUG', False) |