コード例 #1
0
ファイル: index.py プロジェクト: isensen/UUBlog
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())
コード例 #2
0
ファイル: viewindex.py プロジェクト: scorpiozj/UUBlog
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())
コード例 #3
0
ファイル: viewindex.py プロジェクト: chen200910a/UUBlog
    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()
コード例 #4
0
    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()