def index(request): userInfos = viewaccounts.UsersMeta(request, -1) myModules = ["newuserlist", "hotarticlelist", "newarticlelist"] moduleParams = {} for myModule in myModules: moduleParams.setdefault(myModule, {}) moduleList = modules.GetModuleList(moduleParams) channelIds = {1, 2, 3} #channelIds.add() articleList = {} for channelId in channelIds: channel = Channel.objects.get(id=channelId) if channel: retValue = pub.getModelResult(Article, "-createtime", channel1_id=channelId, status=1, ishome=1) #retValue=Article.objects.order_by("-createtime").filter(channel1_id=channelId) articleList.setdefault(channel, retValue) return pub.my_render_to_response(request, "index.html", locals())
def index(request): userInfos=viewaccounts.UsersMeta(request,-1) myModules=["newuserlist","hotarticlelist","newarticlelist"] moduleParams={} for myModule in myModules: moduleParams.setdefault(myModule,{}) moduleList=modules.GetModuleList(moduleParams) channels=Channel.objects.filter(parent_id=0) articleList={} for channel in channels: retValue=pub.getModelResult(Article,"-createtime",channel1_id=channel.id,status=1,ishome=1) #retValue=Article.objects.order_by("-createtime").filter(channel1_id=channelId) articleList.setdefault(channel,retValue) return pub.my_render_to_response(request,"blog/index.html",locals())
def GetContext(self, **kwargs): uid=int(kwargs.get("uid",0)) myModules=["newuserlist","hotarticlelist","newarticlelist"] moduleParams={} for myModule in myModules: moduleParams.setdefault(myModule,{}) moduleList=modules.GetModuleList(moduleParams) channels=Channel.objects.filter(parent_id=0) articleList={} for channel in channels: retValue=pub.getModelResult(Article,"-createtime",channel1_id=channel.id,status=1,ishome=1) #retValue=Article.objects.order_by("-createtime").filter(channel1_id=channelId) articleList.setdefault(channel,retValue) self.template_name="blog/index.html" return locals()
def GetContext(self, **kwargs): uid = int(kwargs.get("uid", 0)) myModules = ["newuserlist", "hotarticlelist", "newarticlelist"] moduleParams = {} for myModule in myModules: moduleParams.setdefault(myModule, {}) moduleList = modules.GetModuleList(moduleParams) channels = Channel.objects.filter(parent_id=0) articleList = {} for channel in channels: retValue = pub.getModelResult(Article, "-createtime", channel1_id=channel.id, status=1, ishome=1) #retValue=Article.objects.order_by("-createtime").filter(channel1_id=channelId) articleList.setdefault(channel, retValue) self.template_name = "blog/index.html" return locals()