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 })
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 })
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 })
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 })
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 })
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 })