def delete(self, *args):
        Invitation.get(self.params.key).delete()
        if self.isAjax:
            self.response.headers["Content-Type"] = ct.JSON
            return """{message:"Item is deleted"}"""
        else:
            from BordjControllers import DolgController

            self.redirect(DolgController.get_url())
 def index(self, accepted=False, *args):
     results = None
     index = 0
     count = 20
     try:
         index = int(self.params.index)
         count = int(self.params.count)
     except:
         pass
     nextIndex = index + count
     previousIndex = index <= 0 and -1 or (index - count > 0 and 0 or index - count)
     result = {"InvitationList": Invitation.all().filter("Accepted = ", accepted).fetch(limit=count, offset=index)}
     result.update(locals())
     return result