本文整理汇总了Python中models.Person.activationdate方法的典型用法代码示例。如果您正苦于以下问题:Python Person.activationdate方法的具体用法?Python Person.activationdate怎么用?Python Person.activationdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Person
的用法示例。
在下文中一共展示了Person.activationdate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: go
# 需要导入模块: from models import Person [as 别名]
# 或者: from models.Person import activationdate [as 别名]
def go(request):
tabselected = None
filtertag = request.META['PATH_INFO']
if filtertag.find('/idea/') >= 0:
filtertag = filtertag[6:]
tabselected = filtertag.replace('/', '')
# tabselected = 4
else:
filtertag = None
user = request.user
rating = None
if user.is_authenticated():
person = views.getPerson(request)
if person:
pratings = Rating.objects().order_by('score')
if pratings and len(pratings)>=0:
for prating in pratings:
if person.currentRating >= prating.score:
rating = prating
else:
break
else:
person = Person()
person.email = user.email
person.name = str(user)
person.activationdate = datetime.datetime.now()
person.save()
views.incrementStat('users',1)
pratings = Rating.objects().order_by('score')
if pratings and len(pratings)>=0:
for prating in pratings:
if person.currentRating >= prating.score:
rating = prating
else:
break
template_values = {
'user':user,
'tabselected':tabselected,
'filtertag':None,
'rating':rating,
}
path = os.path.join(os.path.dirname(__file__), 'templates/ideas/index.html')
return render_to_response(path, template_values)