示例#1
0
文件: views.py 项目: skoczen/skoczen
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,
    }
示例#2
0
文件: views.py 项目: skoczen/skoczen
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,
    }
示例#3
0
 def handle(self, *args, **options):
     print "Saving...",
     save_correlations()
     print " done."
示例#4
0
 def handle(self, *args, **options):
     print "Saving...",
     save_correlations()
     print " done."