示例#1
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
示例#2
0
文件: views.py 项目: Ionut1994/wouso
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
示例#3
0
文件: views.py 项目: narcisaam/wouso
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
示例#4
0
 def post(self, request, *args, **kwargs):
     switchboard = GamesSwitchboard()
     for s in switchboard.props():
         val = request.POST.get(s.name, '')
         s.set_value(val)
     return redirect('games_home')
示例#5
0
 def post(self, request, *args, **kwargs):
     switchboard = GamesSwitchboard()
     for s in switchboard.props():
         val = request.POST.get(s.name, '')
         s.set_value(val)
     return redirect('games_home')