Esempio n. 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 '#'
Esempio n. 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 '#'
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 7
0
 def get_absolute_url(self):
     return reverse("profile_public", args=[self.user])
Esempio n. 8
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])
Esempio n. 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 ] )
Esempio n. 10
0
 def get_absolute_url(self):
     return reverse("profile_public", args=[self.user])