Beispiel #1
0
 def getUserMessage(self, id, user):
     message = None
     try:
         message = UserMessage.get_by_id(int(id))
         if message.user.id <> user.id:
             message = None
     except:
         message = None
     return message
Beispiel #2
0
 def getUserMessage(self, id, user):
     message = None
     try:
         message = UserMessage.get_by_id(int(id))
         if message.user.id <> user.id:
             message = None
     except:
         message = None
     return message
Beispiel #3
0
    def getMessageCount(self, filter_dict, user):
        message_list = UserMessage.all()

        if filter_dict:
            for filter_key in filter_dict.keys():
                message_list = message_list.filter(filter_key, filter_dict[filter_key])

        if user:
            message_list = message_list.filter("user", user)

        return message_list.count()
Beispiel #4
0
    def getMessageCount(self, filter_dict, user):
        message_list = UserMessage.all()

        if filter_dict:
            for filter_key in filter_dict.keys():
                message_list = message_list.filter(filter_key,
                                                   filter_dict[filter_key])

        if user:
            message_list = message_list.filter('user', user)

        return message_list.count()
Beispiel #5
0
    def getMessageList(self, filter_dict, orderby, pagesize, pagecount, user):
        message_list = UserMessage.all()

        if filter_dict:
            for filter_key in filter_dict.keys():
                message_list = message_list.filter(filter_key, filter_dict[filter_key])

        if user:
            message_list = message_list.filter("user", user)

        total_records = message_list.count()

        if orderby:
            message_list = message_list.order(orderby)

        if pagesize > 0:
            message_list = message_list.fetch(pagesize, pagesize * (pagecount - 1))

        return message_list, total_records
Beispiel #6
0
    def getMessageList(self, filter_dict, orderby, pagesize, pagecount, user):
        message_list = UserMessage.all()

        if filter_dict:
            for filter_key in filter_dict.keys():
                message_list = message_list.filter(filter_key,
                                                   filter_dict[filter_key])

        if user:
            message_list = message_list.filter('user', user)

        total_records = message_list.count()

        if orderby:
            message_list = message_list.order(orderby)

        if pagesize > 0:
            message_list = message_list.fetch(pagesize,
                                              pagesize * (pagecount - 1))

        return message_list, total_records
Beispiel #7
0
 def createMessage(self, title, content, user):
     message = UserMessage(title=title, content=content, user=user)
     message.put()
Beispiel #8
0
 def createMessage(self, title, content, user):
     message = UserMessage(title=title, content=content, user=user)
     message.put()