示例#1
0
 def get(self):
     uname=self.request.get('UserName') or ''
     replayType='21'
     idset=set()
     contentlist=[]
     getMapList(contentlist,APPCODE+'-s1',APPCODE,'',APPCODE,'100',u'图片组','','1',replayType)
     if uname:
         u=User.get_by_key_name('u000')
         for ugid in u.grouplist:
             if ugid not in idset:
                 imggroup=ImgGroup.get_by_id(ugid)
                 getMapList(contentlist,APPCODE+'-s1-'+str(imggroup.key().id()),APPCODE+'-s1','',APPCODE,'101',imggroup.group+u'(默认)',imggroup.updateTime,'1',replayType)
                 idset.add(ugid)
         u=User.get_by_key_name('u'+uname)
         if u:
             for ugid in u.grouplist:
                 if ugid not in idset:
                     imggroup=ImgGroup.get_by_id(ugid)
                     getMapList(contentlist,APPCODE+'-s1-'+str(imggroup.key().id()),APPCODE+'-s1','',APPCODE,'101',imggroup.group+u'(已下载)',imggroup.updateTime,'1',replayType)
                     idset.add(ugid)
     for imggroup in ImgGroup.all():
         if imggroup.key().id() not in idset:
             getMapList(contentlist,APPCODE+'-s1-'+str(imggroup.key().id()),APPCODE+'-s1','',APPCODE,'101',imggroup.group,imggroup.updateTime,'1',replayType)
             idset.add(ugid)
     xml,datas=infoallxmldic(contentlist)
     self.response.out.write(xml.toxml('utf-8'))
示例#2
0
 def get(self):
     imgid=self.request.get("imgid") or ''
     group=None
     groupid=self.request.get('groupid') or ''
     if groupid:
         groupid=int(groupid)
         group=ImgGroup.get_by_id(int(groupid))
     grouplist=ImgGroup.all().order('-updateTime')
     self.render('templates/picadd.html',{'groupid':groupid,'group':group,'grouplist':grouplist,'imgid':imgid})
示例#3
0
 def get(self):
     updateid=self.request.get('groupid') or ''
     group=''
     if updateid:
         group=ImgGroup.get_by_id(int(updateid))
         if group:
             group=group.group
     grouplist=ImgGroup.all().order('-updateTime')
     self.render('templates/group.html',{'grouplist':grouplist,'updateid':updateid,'group':group})
示例#4
0
 def get(self):
     user=self.request.get('UserName') or '000'
     if user:
         u=User.get_by_key_name('u'+user)
         grouplist=[]
         if u:
             grouplist=ImgGroup.get_by_id(u.grouplist)
         self.render('templates/groupuser.html',{'usergrouplist':grouplist,'grouplist':ImgGroup.all()})
示例#5
0
    def get(self):
        groupid=self.request.get('groupid')
        group=ImgGroup.get_by_id(int(groupid))
        imglist=[]
        if group:
            imglist=Img.all().filter('group =',group.key().id()).order('-__key__').fetch(10)

        self.render('templates/piclist.html',{'group':group,'imglist':imglist})
示例#6
0
 def get(self):
     uname=self.request.get('UserName') or ''
     xml=None
     lib=None
     if uname:
         grouplist=[]
         u=User.get_by_key_name('u'+uname)
         if u:
             grouplist+=u.grouplist
         u=User.get_by_key_name('u000')
         if u:
             grouplist+=u.grouplist
         for group in grouplist:
             imglist=Img.all().filter('group =',group)
             grouptxt=ImgGroup.get_by_id(group).group
             xml,lib=infoallimgxmldic(imglist,xml,lib,group,grouptxt)
         if xml:
             self.response.out.write(xml.toxml('utf-8'))
示例#7
0
 def post(self):
     group=self.request.get('group')
     groupid=self.request.get('id')
     if group:
         g=None
         if groupid:
             g=ImgGroup.get_by_id(int(groupid))
         if not g:
             g=ImgGroup()
         g.group=group
         g.lib='sys'
         g.put()
     self.redirect('/group')