当前位置: 首页>>代码示例>>Python>>正文


Python Activity.objects方法代码示例

本文整理汇总了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))
开发者ID:NCZkevin,项目名称:pyweb-test,代码行数:27,代码来源:views.py

示例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())
开发者ID:NCZkevin,项目名称:pyweb-test,代码行数:5,代码来源:models.py

示例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())
开发者ID:NCZkevin,项目名称:pyweb-test,代码行数:5,代码来源:models.py

示例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)
开发者ID:NCZkevin,项目名称:pyweb-test,代码行数:5,代码来源:models.py

示例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)
开发者ID:longshenzhu,项目名称:COC,代码行数:5,代码来源:models.py

示例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()
开发者ID:pgwt,项目名称:COC,代码行数:5,代码来源:models.py


注:本文中的activity.models.Activity.objects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。