Ejemplo n.º 1
0
    def get_context_data(self, **kwargs):
        intro_text = settings.DEMO_PAGE_INTRO_TEXT
        context = super(DemoIndex, self).get_context_data(**kwargs)

        session_info = []
        for session_config in get_session_configs_list():
            session_info.append(
                {
                    'name': session_config['name'],
                    'display_name': session_config['display_name'],
                    'url': reverse(
                        'create_demo_session', args=(session_config['name'],)
                    ),
                    'num_demo_participants': session_config[
                        'num_demo_participants'
                    ]
                }
            )

        context.update({
            'session_info': session_info,
            'intro_text': intro_text,
            'is_debug': settings.DEBUG
        })
        return context
Ejemplo n.º 2
0
 def get(self, *args, **kwargs):
     session_configs_info = []
     for session_config in get_session_configs_list():
         session_name = session_config['name']
         key = self.request.GET.get('mturk', 0)
         url = '/create_session/{}/?mturk={}'.format(session_name, key)
         session_configs_info.append(
             {'display_name': session_config['display_name'], 'url': url})
     return TemplateResponse(
         self.request, 'otree/admin/SessionListing.html',
         {'session_configs_info': session_configs_info})
Ejemplo n.º 3
0
 def get(self, *args, **kwargs):
     session_configs_info = []
     for session_config in get_session_configs_list():
         session_name = session_config['name']
         key = self.request.GET.get('mturk', 0)
         url = '/create_session/{}/?mturk={}'.format(session_name, key)
         session_configs_info.append({
             'display_name':
             session_config['display_name'],
             'url':
             url
         })
     return TemplateResponse(self.request,
                             'otree/admin/SessionListing.html',
                             {'session_configs_info': session_configs_info})
Ejemplo n.º 4
0
    def get_context_data(self, **kwargs):
        intro_text = settings.DEMO_PAGE_INTRO_TEXT
        context = super(DemoIndex, self).get_context_data(**kwargs)

        session_info = []
        for session_config in get_session_configs_list():
            session_info.append({
                'name':
                session_config['name'],
                'display_name':
                session_config['display_name'],
                'url':
                reverse('create_demo_session',
                        args=(session_config['name'], )),
                'num_demo_participants':
                session_config['num_demo_participants']
            })

        context.update({
            'session_info': session_info,
            'intro_text': intro_text,
            'is_debug': settings.DEBUG
        })
        return context
Ejemplo n.º 5
0
 def get_queryset(self):
     return get_session_configs_list()