from flask.views import View
from flask import render_template
from flask import request
from flask import redirect
from flask import url_for
from forms.forms import SearchForm


class BaseView(View):

    def __init__(self, template_name):
        self.template_name = template_name

    def provide_context(self):
        raise NotImplementedError

    def render_template(self, context={}):
        return render_template(self.template_name, **context)

    def dispatch_request(self, **kwargs):
        self.parameters = kwargs
        if request.method == 'POST':
            result = self.post()
            if result:
                return self.render_template(context=result)
            return redirect(self.redirect)
        context = self.provide_context()
        if context.get('status', 200) == 404:
            self.template_name = '404.html'
        context['search_form'] = SearchForm()
        return self.render_template(context=context), context.get('status')

2092c15457fae43938b8e7cfe2fe85453d41ed1c
<mask token>


class BaseView(View):
    <mask token>

    def provide_context(self):
        raise NotImplementedError
    <mask token>
    <mask token>

<mask token>


class BaseView(View):
    <mask token>

    def provide_context(self):
        raise NotImplementedError

    def render_template(self, context={}):
        return render_template(self.template_name, **context)

    def dispatch_request(self, **kwargs):
        self.parameters = kwargs
        if request.method == 'POST':
            result = self.post()
            if result:
                return self.render_template(context=result)
            return redirect(self.redirect)
        context = self.provide_context()
        if context.get('status', 200) == 404:
            self.template_name = '404.html'
        context['search_form'] = SearchForm()
        return self.render_template(context=context), context.get('status')

<mask token>


class BaseView(View):

    def __init__(self, template_name):
        self.template_name = template_name

    def provide_context(self):
        raise NotImplementedError

    def render_template(self, context={}):
        return render_template(self.template_name, **context)

    def dispatch_request(self, **kwargs):
        self.parameters = kwargs
        if request.method == 'POST':
            result = self.post()
            if result:
                return self.render_template(context=result)
            return redirect(self.redirect)
        context = self.provide_context()
        if context.get('status', 200) == 404:
            self.template_name = '404.html'
        context['search_form'] = SearchForm()
        return self.render_template(context=context), context.get('status')

from flask.views import View
from flask import render_template
from flask import request
from flask import redirect
from flask import url_for
from forms.forms import SearchForm


class BaseView(View):

    def __init__(self, template_name):
        self.template_name = template_name

    def provide_context(self):
        raise NotImplementedError

    def render_template(self, context={}):
        return render_template(self.template_name, **context)

    def dispatch_request(self, **kwargs):
        self.parameters = kwargs
        if request.method == 'POST':
            result = self.post()
            if result:
                return self.render_template(context=result)
            return redirect(self.redirect)
        context = self.provide_context()
        if context.get('status', 200) == 404:
            self.template_name = '404.html'
        context['search_form'] = SearchForm()
        return self.render_template(context=context), context.get('status')
