Exemplo n.º 1
0
 def get(self):
     notelist=[]
     for note in DaTingNote.all():
         note.groupobj=getGroup(note.group)
         notelist.append(note)
     self.render('templates/daTingNoteList.html',{'datingNoteList':notelist})
     pass
Exemplo n.º 2
0
 def get(self):
     datingNoteId=self.request.get('id')
     if datingNoteId:
         n=DaTingNote.get_by_id(int('id'))
         if n:
             n.delete()
             self.redirect('/daTingNoteList')
             return
     notelist=[]
     for note in DaTingNote.all():
         note.groupobj=getGroup(note.group)
         notelist.append(note)
     self.render('templates/daTingNoteList.html',{'datingNoteList':notelist})
     pass
Exemplo n.º 3
0
                groupid=int(groupid)
            except Exception,e:
                logging.info(str(e))
                self.response.out.write('1')
                return
        if noteid:
            try:
                noteid=int(noteid)
            except Exception,e:
                logging.info(str(e))
                self.response.out.write('1')
                return
        #判断用户是否具有发表帖子的权限
        #?
#        group=Group.get_by_id(groupid)
        group=getGroup(groupid)
        if group:


            if mod=='add':
                note=DaTingNote()
            else:
                msg=u'修改帖子成功'
                note=DaTingNote.get_by_id(noteid)
            note.group=groupid
            note.author=username
            note.content=content
            note.title=title

            note.updateTime=noteupdate
            #####