Created
June 20, 2017 17:38
-
-
Save khajvahmac/e2c141afe401c71610fa20b9db3c459d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyramid import exceptions | |
class BaseView: | |
def __init__(self, request): | |
self.request = request | |
def __call__(self, *args, **kwargs): | |
if self.request.method == "GET": | |
return self.get() | |
elif self.request.method == "POST": | |
return self.post() | |
elif self.request.method == "DELETE": | |
return self.delete() | |
elif self.request.method == "PUT": | |
return self.put() | |
elif self.request.method == "OPTIONS": | |
return self.option() | |
def get(self): | |
return exceptions.HTTPNotFound() | |
def post(self): | |
return exceptions.HTTPNotFound() | |
def option(self): | |
return exceptions.HTTPNotFound() | |
def delete(self): | |
return exceptions.HTTPNotFound() | |
def put(self): | |
return exceptions.HTTPNotFound() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment