本文整理汇总了Python中models.Group.max_loan_days方法的典型用法代码示例。如果您正苦于以下问题:Python Group.max_loan_days方法的具体用法?Python Group.max_loan_days怎么用?Python Group.max_loan_days使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Group
的用法示例。
在下文中一共展示了Group.max_loan_days方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save_new_group
# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import max_loan_days [as 别名]
def save_new_group(request):
if request.method == 'POST':
form = GroupForm(request.POST)
if form.is_valid():
group = Group()
group.name = form.cleaned_data['name']
group.max_loan_days = form.cleaned_data['max_loan_days']
group.save()
return HttpResponseRedirect('/webconf/couchauth/')
示例2: show_group
# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import max_loan_days [as 别名]
def show_group(request, group_id):
try:
group = Group.get(group_id)
except:
return HttpResponseRedirect('/webconf/couchauth/show_groups/')
form = GroupForm(instance=group)
if form.is_valid():
group = Group()
group.name = form.cleaned_data['name']
group.max_loan_days = form.cleaned_data['max_loan_days']
group.save()
form_url = "/webconf/couchauth/save_group/%s/" % group_id
context = { 'form': form,
'form_title': 'Editar Grupo',
'group': group,
'form_url': form_url,
}
return render_to_response('webconf/couchauth/form_group.html',
context,
context_instance=RequestContext(request)
)