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

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/d/j/django-hitcount-HEAD/hitcount/templatetags/hitcount_tags.py   django-hitcount(Download)
    def render(self, context):
        ctype, object_pk = get_target_ctype_pk(context, self.object_expr)
 
        try:
            obj, created = HitCount.objects.get_or_create(content_type=ctype, 
    def render(self, context):
        ctype, object_pk = get_target_ctype_pk(context, self.object_expr)
 
        obj, created = HitCount.objects.get_or_create(content_type=ctype, 
                        object_pk=object_pk)

src/o/p/Open-Knesset-HEAD/auxiliary/views.py   Open-Knesset(Download)
    # update the it count
    ctype = ContentType.objects.get(app_label="planet", model="post")
    hitcount, created = HitCount.objects.get_or_create(content_type=ctype,
                                                  object_pk=post_id)
    result = _update_hit_count(request, hitcount)