Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(1)  |  Derive(0)  |  Import(4)

src/d/j/django-cached-hitcount-0.1.9/cached_hitcount/admin.py   django-cached-hitcount(Download)
from django.contrib import admin
 
from cached_hitcount.models import Hit,BlacklistIP
 
class HitAdmin(admin.ModelAdmin):

src/d/j/django-cached-hitcount-0.1.9/cached_hitcount/utils.py   django-cached-hitcount(Download)
def get_hit_count(*args, **kwargs):
    from cached_hitcount.models import Hit#avoid circular import
 
 
    hits =  Hit.objects.all()

src/d/j/django-cached-hitcount-0.1.9/cached_hitcount/tasks.py   django-cached-hitcount(Download)
from cached_hitcount.utils import get_hitcount_cache, is_cached_hitcount_enabled
from cached_hitcount.settings import CACHED_HITCOUNT_CACHE, CACHED_HITCOUNT_CACHE_TIMEOUT, CACHED_HITCOUNT_IP_CACHE
from cached_hitcount.models import Hit
 
logger = logging.getLogger(__name__)

src/d/j/django-cached-hitcount-0.1.9/cached_hitcount/tests.py   django-cached-hitcount(Download)
 
from cached_hitcount.utils import is_cached_hitcount_enabled
from cached_hitcount.models import Hit
from cached_hitcount.utils import get_target_ctype_pk, get_hit_count
from cached_hitcount.tasks import persist_hits
    def _create_sample_model(self):
        self.sample_model = Hit()
        self.sample_model.object_pk = 435
        ctype, object_pk = get_target_ctype_pk(self.sample_model)
        self.sample_model.content_type = ctype