Exemplo n.º 1
0
def create_talk(request, session, room_id):
    room = Room.get_by_key_name(room_id)
    talk = Talk(title = 'New Talk', room = room, session = int(session))
    if request.method == "GET":
        return show_talk_form_to_edit(request, TalkForm(instance=talk))
    else:
        return save_talk_form(request, talk)
Exemplo n.º 2
0
 def __init__(self):
     for session in Talk.get_talk_sessions():
         room_dict = {}
         for room in Room.get_rooms():
             room_dict[room.name] = None
         self.grid[session]= dict(room_dict)
             
     for talk in Talk.all().fetch(1000):
         if talk.session:
             self.add_talk(talk)
Exemplo n.º 3
0
 def get_rows_for_template(self):
     session_rows = []
     contador = 0
     for session in Talk.get_talk_sessions():
         row = SessionRow(session)
         for room in Room.get_rooms():
             if self.grid[session][room.name]:
                 self.grid[session][room.name].contador = contador
             row.add_talk(self.grid[session][room.name])
             contador = contador + 1
         session_rows.append(row)
     return session_rows
Exemplo n.º 4
0
def init_app(request):
    if request.method == 'GET':
        User.create_admin('admin', 'aos').put()
        Room.init_rooms()
        if not Talk.all().count(1) > 0:
            talk = Talk(title = 'Android', session=1)
            talk.set_room(Room.get_rooms()[0])
            talk.put()
            talk = Talk(title = 'Kanban', session=5)
            talk.set_room(Room.get_rooms()[1])
            talk.put()
        if not Attendant.all().count(1) > 0:
            bill = Attendant.create('Bill', 'Gates', '*****@*****.**', 'Zaragoza', False)
            bill.twitter_id = 'fbgblog'
            bill.set_as_speaker()
            bill.put()
            richard = Attendant.create('Richard', 'Stallman', '*****@*****.**', 'Pamplona', True)
            richard.twitter_id = 'GNUplusLINUX'
            richard.set_as_speaker()
            richard.put()
        return HttpResponse("App ready to rumble...", mimetype="text/plain")
Exemplo n.º 5
0
def show_timetable(request):
    user = request.session.get('user')
    timetable = Timetable()
    rooms = Room.get_rooms()
    sessions = Talk.get_talk_sessions()
    return render_to_response('timetable_app.html', {'user': user, 'rooms': rooms, 'sessions': sessions, 'rows': timetable.get_rows_for_template()})