コード例 #1
0
def logged_in_home(request, form=None):
    message_form = form or TimelineForm(request.user)
    follow_form = FollowTweetersForm(instance=request.user.get_profile())
    followed_tweeters = request.user.get_profile().followed_tweeters.all()
    timeline = Timeline.get_recent_updates(request.user)

    return {'timeline': timeline,
        'followed_tweeters': followed_tweeters,
        'form':message_form,
        'follow_form':follow_form}
コード例 #2
0
def main(request):
    if request.user.is_authenticated():
        return logged_in_home(request)
    else:
        return {'timeline': Timeline.get_recent_updates() }