def correlations(request): private_data = ["o****m", "sex_count",] choices = OrderedDict() if request.user.username != "skoczen" or 'all' not in request.GET: for k, v in CORRELATION_CHOICES.items(): if k not in private_data: choices[k] = v else: choices = CORRELATION_CHOICES correlations = cache.get("current_correlations", None) if not correlations: save_correlations() correlations = cache.get("current_correlations") return { "correlations": correlations, "CORRELATION_CHOICES": choices, }
def correlations(request): private_data = [ "o****m", "sex_count", ] choices = OrderedDict() if request.user.username != "skoczen" or 'all' not in request.GET: for k, v in CORRELATION_CHOICES.items(): if k not in private_data: choices[k] = v else: choices = CORRELATION_CHOICES correlations = cache.get("current_correlations", None) if not correlations: save_correlations() correlations = cache.get("current_correlations") return { "correlations": correlations, "CORRELATION_CHOICES": choices, }
def handle(self, *args, **options): print "Saving...", save_correlations() print " done."