Exemple #1
0
def _post_tweet(request):
    myuser = request.user.tweeter
    tweet_form = open_newsforms.TweetForm(request.POST)
    if tweet_form.is_valid():
        tweet_form.save()
        tweet_form = open_newsforms.TweetForm()
    return render(request, 'mainpage.html', {
        'tweet_form': tweet_form,
        'myuser': myuser
    })
Exemple #2
0
def month(request):
    tweet_form = open_newsforms.TweetForm()
    open_news_article = Article.objects.order_by('-pointnum')
    return render(request, 'month.html', {
        'tweet_form': tweet_form,
        'open_news_article': open_news_article
    })
Exemple #3
0
def yj(request):
    tweet_form = open_newsforms.TweetForm()
    open_news_article = Article.objects.order_by('-ftime')
    return render(request, 'yj.html', {
        'tweet_form': tweet_form,
        'open_news_article': open_news_article
    })
Exemple #4
0
def luntan(request):
    tweet_form = open_newsforms.TweetForm()
    open_news_article = Article.objects.order_by('-answernum')
    return render(request, 'luntan.html', {
        'tweet_form': tweet_form,
        'open_news_article': open_news_article
    })
Exemple #5
0
def zuozhe(request):
    tweet_form = open_newsforms.TweetForm()
    open_news_article = Article.objects.order_by('-zhutinum')
    return render(request, 'zuozhe.html', {
        'tweet_form': tweet_form,
        'open_news_article': open_news_article
    })
Exemple #6
0
def _profile_page_get(request):
    myuser = request.user.tweeter
    tweet_form = open_newsforms.TweetForm()
    open_news_article = Article.objects.order_by('-pointnum')
    return render(
        request, 'mainpage.html', {
            'tweet_form': tweet_form,
            'open_news_article': open_news_article,
            'myuser': myuser
        })