本文整理汇总了Python中models.Feedback.type方法的典型用法代码示例。如果您正苦于以下问题:Python Feedback.type方法的具体用法?Python Feedback.type怎么用?Python Feedback.type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Feedback
的用法示例。
在下文中一共展示了Feedback.type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: render_feedback
# 需要导入模块: from models import Feedback [as 别名]
# 或者: from models.Feedback import type [as 别名]
def render_feedback(request):
# get system status
systemStatus = SystemStatus()
systemStatus.get()
c = RequestContext(request, {"version": systemStatus.version, "is_message": False, "feedback": True})
c.update(csrf(request))
# save bug/feature in session if "Save" clicked
if request.method == "POST":
if "add" in request.POST:
issue = Feedback()
issue.type = request.POST["type"]
issue.description = request.POST["description"]
issue.status = "pending"
issue.save()
c.update({"is_message": True})
# get all bugs and features
bug_list = Feedback.objects.filter(type = "bug").order_by("-status")
feature_list = Feedback.objects.filter(type = "feature").order_by("-status")
c.update({"bug_list": bug_list, "feature_list": feature_list})
return render_to_response("feedback.html", c)