def summary_view(self, message): connect() result = [] for user in User.objects(): updates = StatusUpdateUserAggregated.objects(user_id=user.user_id).limit(5) if not len(updates): continue template = rendered_template("show_updates.html", {"user": user, "updates": updates}) self.reply(message, template, html=True)
def summary_view(self, message): connect() result = [] for user in User.objects(): updates = StatusUpdateUserAggregated.objects(user_id=user.user_id).limit(5) if not len(updates): continue template = rendered_template("show_updates.html", {"user":user, "updates":updates}) self.reply(message, template, html=True)
def show_updates(self, message, nick): # shows updates for a single user connect() try: if not nick: user = self.get_user(message) else: user = User.get_by_nick(nick) except User.DoesNotExist: self.reply(message, "%s does not exist yet." % nick) return updates = StatusUpdateUserAggregated.objects(user_id=user.user_id).limit(10) template = rendered_template("show_updates.html", {"user": user, "updates": updates}) self.reply(message, template, html=True)
def show_updates(self, message, nick): # shows updates for a single user connect() try: if not nick: user = self.get_user(message) else: user = User.get_by_nick(nick) except User.DoesNotExist: self.reply(message, "%s does not exist yet." % nick) return updates = StatusUpdateUserAggregated.objects(user_id=user.user_id).limit(10) template = rendered_template("show_updates.html", {"user":user, "updates":updates}) self.reply(message, template, html=True)