Ejemplo n.º 1
0
def profile_detail(request, username):
    ctx = {}
    view_user = get_object_or_404(User, username=username)
    if request.user.is_authenticated() and request.user.username == username:
        ctx['timelines'] = view_user.timeline_set.exclude(status='del').order_by('-updated_on')
    else:
        ctx['timelines'] = get_all_timlines().filter(created_by=view_user)
    return __profile_detail(request, username, extra_context=ctx)
Ejemplo n.º 2
0
def profile_detail(request, username):
    ctx = {}
    view_user = get_object_or_404(User, username=username)
    if request.user.is_authenticated() and request.user.username == username:
        ctx['timelines'] = view_user.timeline_set.exclude(
            status='del').order_by('-updated_on')
    else:
        ctx['timelines'] = get_all_timlines().filter(created_by=view_user)
    return __profile_detail(request, username, extra_context=ctx)
Ejemplo n.º 3
0
def tl_recommend(template='timeline/widgets/recommend.html'):
    return {
        'template': template,
        'timelines': get_all_timlines().order_by('-rec_on')[:5]
    }
Ejemplo n.º 4
0
def tl_last(template='timeline/widgets/last.html'):
    return {
        'template': template,
        'timelines': get_all_timlines().order_by('-updated_on')[:5]
    }
Ejemplo n.º 5
0
def tl_hot(template='timeline/widgets/hot.html'):
    return {
        'template': template,
        'timelines': get_all_timlines().order_by('-num_views')[:5]
    }
Ejemplo n.º 6
0
 def items(self):
     return get_all_timlines()
Ejemplo n.º 7
0
 def items(self):
     return get_all_timlines()
Ejemplo n.º 8
0
def tl_recommend(template='timeline/widgets/recommend.html'):
    return {'template': template,
            'timelines': get_all_timlines().order_by('-rec_on')[:5] }
Ejemplo n.º 9
0
def tl_last(template='timeline/widgets/last.html'):
    return {'template': template,
            'timelines': get_all_timlines().order_by('-updated_on')[:5] }
Ejemplo n.º 10
0
def tl_hot(template='timeline/widgets/hot.html'):
    return {'template': template,
            'timelines': get_all_timlines().order_by('-num_views')[:5] }