本文整理汇总了Python中models.Entry.author方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.author方法的具体用法?Python Entry.author怎么用?Python Entry.author使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Entry
的用法示例。
在下文中一共展示了Entry.author方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models import Entry [as 别名]
# 或者: from models.Entry import author [as 别名]
def post(self):
"""
/api/item, POST, create item
表单字段: url, author, title, content
"""
p = Entry()
p.url = self.request.get('tUrl')
p.author = self.request.get('tAuthor')
p.title = self.request.get('tTitle')
p.content = self.request.get('tContent')
p.tags = self.request.get('tTags').split(',')
p.put(); # save
self.response.headers['Content-Type'] = 'application/json'
self.response.out.write('{ "success":true, "id":%s }' % p.key().id())
示例2: post
# 需要导入模块: from models import Entry [as 别名]
# 或者: from models.Entry import author [as 别名]
def post(self):
#表单字段: url, author, title, content, allow_sendto_kindle
bSendIt = self.request.get('bSendIt')
p = Entry()
p.url = self.request.get('tUrl')
p.author = self.request.get('tAuthor')
p.title = self.request.get('tTitle')
p.content = self.request.get('tContent')
p.tags = self.request.get('tTags').split(',')
p.put(); # save
#send to kindle
if bSendIt:
common.add_task_sendmail(p.key().id());
return self.redirect('/list/1')
示例3: createOrUpdate
# 需要导入模块: from models import Entry [as 别名]
# 或者: from models.Entry import author [as 别名]
def createOrUpdate(request):
log.info("createOrUpdate")
updatedId = -1
if (request.method == 'POST'):
entryId = int(request.POST['entryId'])
log.debug("entryId %d" % entryId)
if (entryId == -1):
entry = Entry()
entry.author = getDefaultAuthor()
entry.dateWritten = datetime.now()
else:
entry = Entry.objects.get(pk = entryId)
entry.body = request.POST['body']
entry.save()
updatedId = entry.id
return HttpResponse(simplejson.dumps({ 'updatedId': updatedId }),\
mimetype='application/javascript')