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
# -*- coding: utf-8 -*- | |
import hashlib | |
from celery.task import Task | |
from django.core.cache import cache | |
class SingleTask(Task): | |
""" | |
class AddTask(SingleTask): | |
def run_main(self, x, y): |
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
def handle_bool(value): | |
if value in [True, 'true', 'True', 'TRUE', 1]: | |
return True | |
return False |
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
import sys | |
sys.setdefaultencoding('utf-8') |
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
# -*- coding: utf-8 -*- | |
from django.contrib import admin | |
from django.http import HttpResponse | |
class OwnerPermissionAdmin(admin.ModelAdmin): | |
def queryset(self, request): | |
qs = super(OwnerPermissionAdmin, self).queryset(request) | |
if request.user.is_superuser: | |
return qs |
NewerOlder