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)
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
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
def test_get_user_by_nickname(self): user = User.get_user_by_nickname("12") eq_(user,self.user)
def show_user_by_nickname(nickname): userid = User.get_user_by_nickname(nickname).id return redirect(url_for("personal_center",userid=userid))
def show_user_by_nickname(nickname): userid = User.get_user_by_nickname(nickname).id return redirect(url_for("personal_center", userid=userid))