Esempio n. 1
0
    def __init__(self, context, request):

        BaseView.__init__(self, context, request)

        form = context.__data__['form']['data']

        pyramidformview.__init__(self, context, request, form)
Esempio n. 2
0
 def __init__(self, attempt, handler):
     BaseView.__init__(self, handler);
     self.attempt = attempt
     
     template.register_template_library('filters.resolve')
     
     self.values['attempt'] = attempt
     self.values['quiz'] = attempt.quiz
     self.values['quiz_snapshot'] = attempt.snapshot.quiz_entity
     self.values['questions'] = attempt.snapshot.questions
     self.values['responses'] = attempt.responses
Esempio n. 3
0
    def render_to_response(self, context):

        board_model = self.service.get_object_or_404(id=self.kwargs["board_id"])
        board, player_board = ScrabblyService().new(board_model, self.get_current_player())

        context = {"board": board_model, "player_board": player_board }
        context["tiles"] = BoardService().get_tiles(board_model)
        context["is_player_turn"] = self.service.is_player_turn(self.get_current_player(), board_model)

        return BaseView.render_to_response(self, context)
Esempio n. 4
0
    def __call__(self):

        res = BaseView.__call__(self)
        res.update(pyramidformview.__call__(self))

        return res
    def __init__(self, context, request):

        BaseView.__init__(self, context, request)
Esempio n. 6
0
 def render_to_response(self, context):
     
     context["boards"] = self.service.all()
     return BaseView.render_to_response(self, context)