Beispiel #1
0
 def tweet(self):
     from message import NotifyMessage
     nicknames   = find_all_at_users(self.content)
     self.save()
     for nickname in nicknames:
         receiver = User.get_user_by_nickname(nickname)
         if receiver is not None:
             NotifyMessage.add(self.notify_render(),self.poster,receiver)
Beispiel #2
0
    def add(cls, content, tweet, commenter):
        c = Comment(content=content, tweet=tweet, commenter=commenter)
        c.save()

        from message import NotifyMessage
        nicknames = find_all_at_users(c.content)
        for nickname in nicknames:
            receiver = User.get_user_by_nickname(nickname)
            NotifyMessage.add(c.notify_render(), c.commenter, receiver)
        return c
Beispiel #3
0
 def add(cls,content,tweet,commenter):
     c = Comment(content=content, tweet=tweet, commenter=commenter)
     c.save()
     
     from message import NotifyMessage
     nicknames   = find_all_at_users(c.content)
     for nickname in nicknames:
         receiver = User.get_user_by_nickname(nickname)
         NotifyMessage.add(c.notify_render(),c.commenter,receiver)
     return c
Beispiel #4
0
 def test_get_user_by_nickname(self):
     user   = User.get_user_by_nickname("12")
     eq_(user,self.user)
Beispiel #5
0
def show_user_by_nickname(nickname):
    userid      = User.get_user_by_nickname(nickname).id
    return redirect(url_for("personal_center",userid=userid))
Beispiel #6
0
def show_user_by_nickname(nickname):
    userid = User.get_user_by_nickname(nickname).id
    return redirect(url_for("personal_center", userid=userid))