本文整理汇总了Python中activity.models.Activity.objects方法的典型用法代码示例。如果您正苦于以下问题:Python Activity.objects方法的具体用法?Python Activity.objects怎么用?Python Activity.objects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类activity.models.Activity
的用法示例。
在下文中一共展示了Activity.objects方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: showactivity
# 需要导入模块: from activity.models import Activity [as 别名]
# 或者: from activity.models.Activity import objects [as 别名]
def showactivity(request, gurl_number, turl_number):
corporation = Corporation.objects(url_number=gurl_number).get()
activity = Activity.objects(url_number=turl_number).get()
if request.method == 'POST':
if "reply" in request.POST:
reply_form = NewReplyForm(request.POST)
if reply_form.is_valid():
content = reply_form.cleaned_data['content']
reply = Reply(content=content)
sccard = S_C_Card.objects(user=request.user, corporation=corporation).get()
reply.creator = sccard
reply.creat_time = datetime.datetime.now()
reply.target = activity
reply.is_active = True
reply.save()
activity.clicks = topic.clicks - 1
activity.save()
return HttpResponseRedirect('/corporation/' + str(gurl_number) + '/activity/' + str(turl_number) + '/')
else:
reply_form = NewReplyForm()
activity.clicks = activity.clicks + 1
activity.save()
return render_to_response('corporation/activity_corporation.html', {'corporation':corporation, 'current_user':request.user, 'reply_form':reply_form, 'activity':activity, 'STATIC_URL':STATIC_URL}, context_instance=RequestContext(request))
示例2: get_activity_active
# 需要导入模块: from activity.models import Activity [as 别名]
# 或者: from activity.models.Activity import objects [as 别名]
def get_activity_active(self):
from activity.models import Activity
return Activity.objects(creator__in=self.get_sccard_active())
示例3: find_activity
# 需要导入模块: from activity.models import Activity [as 别名]
# 或者: from activity.models.Activity import objects [as 别名]
def find_activity(self):
from activity.models import Activity
return Activity.objects(creator__nin=self.get_corporation_active())
示例4: get_activity_corporation_creat_inactive
# 需要导入模块: from activity.models import Activity [as 别名]
# 或者: from activity.models.Activity import objects [as 别名]
def get_activity_corporation_creat_inactive(self):
from activity.models import Activity
return Activity.objects(creator__in=self.get_sccard_all(), is_active=False)
示例5: get_activity_creat_inactive
# 需要导入模块: from activity.models import Activity [as 别名]
# 或者: from activity.models.Activity import objects [as 别名]
def get_activity_creat_inactive(self):
from activity.models import Activity
return Activity.objects(creator=self, is_active=False)
示例6: get_activity_list
# 需要导入模块: from activity.models import Activity [as 别名]
# 或者: from activity.models.Activity import objects [as 别名]
def get_activity_list(self): # 得到活动列表
from activity.models import Activity
return Activity.objects(sponsor=self).all()