Exemple #1
0
def games(request):
    switchboard = GamesSwitchboard()

    if request.method == "POST":
        for group in (switchboard,):
            for s in group.props():
                val = request.POST.get(s.name, '')
                s.set_value(val)

    return render_to_response('cpanel/customization.html',
                              {'settings': (switchboard,),
                               'module': 'games'},
                              context_instance=RequestContext(request))
Exemple #2
0
class GamesView(TemplateView):
    template_name = 'cpanel/games_home.html'

    def dispatch(self, request, *args, **kwargs):
        self.switchboard = GamesSwitchboard()
        return super(GamesView, self).dispatch(request, *args, **kwargs)

    def post(self, request, *args, **kwargs):
        self.switchboard = GamesSwitchboard()
        for s in self.switchboard.props():
            val = request.POST.get(s.name, '')
            s.set_value(val)
        return redirect('games_home')

    def get_context_data(self, **kwargs):
        context = super(GamesView, self).get_context_data(**kwargs)
        context.update(dict(settings=self.switchboard))
        return context
Exemple #3
0
class GamesView(TemplateView):
    template_name = 'cpanel/customization/games.html'

    def __init__(self, **kwargs):
        super(GamesView, self).__init__(**kwargs)
        self.switchboard = GamesSwitchboard()

    def post(self, request, *args, **kwargs):
        for s in self.switchboard.props():
            val = request.POST.get(s.name, '')
            s.set_value(val)

        return redirect('customization_games')

    def get_context_data(self, **kwargs):
        context = super(GamesView, self).get_context_data(**kwargs)
        context.update(dict(settings=self.switchboard))
        return context
Exemple #4
0
class GamesView(TemplateView):
    template_name = 'cpanel/customization/games.html'

    def __init__(self, **kwargs):
        super(GamesView, self).__init__(**kwargs)
        self.switchboard = GamesSwitchboard()

    def post(self, request, *args, **kwargs):
        for s in self.switchboard.props():
            val = request.POST.get(s.name, '')
            s.set_value(val)

        return redirect('customization_games')

    def get_context_data(self, **kwargs):
        context = super(GamesView, self).get_context_data(**kwargs)
        context.update(dict(settings=self.switchboard))
        return context
Exemple #5
0
 def post(self, request, *args, **kwargs):
     self.switchboard = GamesSwitchboard()
     for s in self.switchboard.props():
         val = request.POST.get(s.name, '')
         s.set_value(val)
     return redirect('games_home')
Exemple #6
0
 def dispatch(self, request, *args, **kwargs):
     self.switchboard = GamesSwitchboard()
     return super(GamesView, self).dispatch(request, *args, **kwargs)
Exemple #7
0
 def get_context_data(self, **kwargs):
     context = super(GamesView, self).get_context_data(**kwargs)
     switchboard = GamesSwitchboard()
     context.update(dict(settings=(switchboard, )))
     return context
Exemple #8
0
 def __init__(self, **kwargs):
     super(GamesView, self).__init__(**kwargs)
     self.switchboard = GamesSwitchboard()
Exemple #9
0
 def __init__(self, **kwargs):
     super(GamesView, self).__init__(**kwargs)
     self.switchboard = GamesSwitchboard()