示例#1
0
    def get(self, meeting_key=None):
        from models.blip import Blip
        login_user = self.get_current_user()
        meeting = Meeting.get(meeting_key)
        if meeting is None or not meeting.is_active:
            return self.error(404)
        if not meeting.has_member(login_user):
            return self.error(401)
        c, p = Profile.get_or_create_from_user(meeting.creator)
        
        admin_profiles = [p]

        member_profiles = []
        members = meeting.members(include_creator=False)
        for u in members:
            c, p = Profile.get_or_create_from_user(u)
            member_profiles.append(p)

        followees = Follow.your_subscribers(login_user)
        followee_profiles = []
        for f in followees:
            if f.to_user not in members:
                c, p = Profile.get_or_create_from_user(f.to_user)
                followee_profiles.append(p)
            
        try:
            page = int(self.request.get('page', '1'))
        except ValueError:
            page = 1

        pagesize = settings.ROOM_PAGE_SIZE
        paginator = SimplePaginator(Blip.qs_for_meeting(meeting),
                                     page, pagesize)
        
        blips = each_profiles(paginator.object_list)
        return self.render('meeting_item.html', locals())
示例#2
0
 def load(self):
     from models.blip import Blip
     q = Blip.qs_for_meeting(self.meeting, order='date_created')
     text = ' '.join(blip.text for blip in q.fetch(3))
     return text