예제 #1
0
def channelurl(channel):
    if channel.type == TYPE_CINEMA:
        return reverse(theater_view, args=[channel.pk])
    elif channel.type == TYPE_TV_CHANNEL:
        return reverse(tvchannel_view, args=[channel.pk])
    else:
        return '#'
예제 #2
0
def channelurl(channel):
    if channel.type == TYPE_CINEMA:
        return reverse(theater_view, args=[channel.pk])
    elif channel.type == TYPE_TV_CHANNEL:
        return reverse(tvchannel_view, args=[channel.pk])
    else:
        return '#'
예제 #3
0
def redirect_to_blog_post(request, username, permalink):

    kwargs = {
            'username': username,
            'permalink': permalink,
    }
    url = reverse('show_article', kwargs=kwargs)
    return redirect_to(request, url=url)
예제 #4
0
def redirect_to_short_review(request, username, permalink):

    try:
        shortreview = ShortReview.objects.select_related('object','user')\
                .get(kind=ShortReview.REVIEW, object__permalink=permalink,
                user__username=username)
    except ShortReview.DoesNotExist:
        raise Http404

    kwargs = {
            'username': username,
            'post_id': shortreview.id,
    }
    url = reverse('show_wall_post', kwargs=kwargs)
    return redirect_to(request, url=url)
예제 #5
0
def comment_form_url(activity, app_label, model):
    """
        Returns url planet comment form
    """

    key = cache.Key("planet-comment-form", app_label, model)
    content_type = cache.get(key)

    if content_type is None:
        content_type = ContentType.objects.get(app_label=app_label, model=model).id
        cache.set(key, content_type)

    kwargs = {
        'content_type' : content_type,
        'object_id' : activity.object_id,
    }

    return reverse('tc_comment', kwargs=kwargs)
예제 #6
0
def comment_form_url(activity, app_label, model):
    """
        Returns url planet comment form
    """

    key = cache.Key("planet-comment-form", app_label, model)
    content_type = cache.get(key)

    if content_type is None:
        content_type = ContentType.objects.get(app_label=app_label, model=model).id
        cache.set(key, content_type)

    kwargs = {
        'content_type' : content_type,
        'object_id' : activity.object_id,
    }

    return reverse('tc_comment', kwargs=kwargs)
예제 #7
0
파일: models.py 프로젝트: thuvh/filmmaster
 def get_absolute_url(self):
     return reverse("profile_public", args=[self.user])
예제 #8
0
파일: models.py 프로젝트: manlan2/filmaster
 def get_absolute_url(self):
     from film20.useractivity.models import UserActivity
     self._act_id = getattr(self, '_act_id',
                            UserActivity.objects.get(demot=self).pk)
     return reverse('show_demot', args=[self.user, self._act_id])
예제 #9
0
 def get_absolute_url( self ):
     from film20.useractivity.models import UserActivity
     self._act_id = getattr( self, '_act_id', UserActivity.objects.get( demot=self ).pk )
     return reverse( 'show_demot', args=[ self.user, self._act_id ] )
예제 #10
0
 def get_absolute_url(self):
     return reverse("profile_public", args=[self.user])