本文整理汇总了Python中bootcamp.feeds.models.Feed.post方法的典型用法代码示例。如果您正苦于以下问题:Python Feed.post方法的具体用法?Python Feed.post怎么用?Python Feed.post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bootcamp.feeds.models.Feed
的用法示例。
在下文中一共展示了Feed.post方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from bootcamp.feeds.models import Feed [as 别名]
# 或者: from bootcamp.feeds.models.Feed import post [as 别名]
def post(request):
last_feed = request.POST.get('last_feed')
user = request.user
csrf_token = unicode(csrf(request)['csrf_token'])
feed = Feed()
feed.user = user
feed.post = request.POST['post']
feed.save()
html = _html_feeds(last_feed, user, csrf_token)
return HttpResponse(html)
示例2: post
# 需要导入模块: from bootcamp.feeds.models import Feed [as 别名]
# 或者: from bootcamp.feeds.models.Feed import post [as 别名]
def post(request):
last_feed = request.POST.get('last_feed')
user = request.user
csrf_token = (csrf(request)['csrf_token'])
feed = Feed()
feed.user = user
post = request.POST['post']
post = post.strip()
if len(post) > 0:
feed.post = post[:255]
feed.save()
html = _html_feeds(last_feed, user, csrf_token)
return HttpResponse(html)
示例3: post
# 需要导入模块: from bootcamp.feeds.models import Feed [as 别名]
# 或者: from bootcamp.feeds.models.Feed import post [as 别名]
def post(request):
last_feed = request.POST.get('last_feed')
user = request.user
csrf_token = unicode(csrf(request)['csrf_token'])
feed = Feed()
feed.user = user
post = request.POST['post']
post = post.strip()
if len(post) > 0:
feed.post = post[:255]
feed.save()
tag = request.session.get('TRIBE_TAG')
html = _html_feeds(tag, last_feed, user, csrf_token)
return HttpResponse(html)