本文整理汇总了Python中models.Token.set方法的典型用法代码示例。如果您正苦于以下问题:Python Token.set方法的具体用法?Python Token.set怎么用?Python Token.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Token
的用法示例。
在下文中一共展示了Token.set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: go_public
# 需要导入模块: from models import Token [as 别名]
# 或者: from models.Token import set [as 别名]
def go_public(request, app_uuid):
from models import Application, Token, UserGroups
app = get_object_or_404(Application, uuid=app_uuid)
if not app.public:
return HttpResponse(u'Permission deny')
if not request.user.get_profile().is_email_confirmed:
return HttpResponse(u'Confirm your email or use direct link http://elib.tsogu.ru/')
try:
ug = UserGroups.objects.get(user=request.user, application=app)
except:
ug = UserGroups(user=request.user, application=app, groups=u' ')
ug.save()
return HttpResponseRedirect(u'%s%s'%(app.link,Token.set(request.user,app)))
示例2: go
# 需要导入模块: from models import Token [as 别名]
# 或者: from models.Token import set [as 别名]
def go(request, app_uuid):
from models import Application, Token
app = get_object_or_404(Application, uuid=app_uuid)
return HttpResponseRedirect(u'%s%s'%(app.link,Token.set(request.user,app)))