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)
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)
def tl_recommend(template='timeline/widgets/recommend.html'): return { 'template': template, 'timelines': get_all_timlines().order_by('-rec_on')[:5] }
def tl_last(template='timeline/widgets/last.html'): return { 'template': template, 'timelines': get_all_timlines().order_by('-updated_on')[:5] }
def tl_hot(template='timeline/widgets/hot.html'): return { 'template': template, 'timelines': get_all_timlines().order_by('-num_views')[:5] }
def items(self): return get_all_timlines()
def tl_recommend(template='timeline/widgets/recommend.html'): return {'template': template, 'timelines': get_all_timlines().order_by('-rec_on')[:5] }
def tl_last(template='timeline/widgets/last.html'): return {'template': template, 'timelines': get_all_timlines().order_by('-updated_on')[:5] }
def tl_hot(template='timeline/widgets/hot.html'): return {'template': template, 'timelines': get_all_timlines().order_by('-num_views')[:5] }