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

        BaseView.__init__(self, context, request)

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

        pyramidformview.__init__(self, context, request, form)
Exemplo 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
Exemplo 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)
Exemplo n.º 4
0
    def __call__(self):

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

        return res
Exemplo n.º 5
0
    def __init__(self, context, request):

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