Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Do not depend on flask-views package (#121)
Browse files Browse the repository at this point in the history
The package only uses [1] which just sets ``self.args`` and ``self.kwargs`` that
are not used anywhere.

[1]: https://github.com/brocaar/flask-views/blob/master/flask_views/base.py#L5-L36
  • Loading branch information
mpessas committed Aug 26, 2019
1 parent 5634697 commit 9a04099
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ defaults: &defaults
- checkout
- run:
name: Install dependencies
command: pipenv install -r $REQUIREMENTS_FILE nose
command: pip install --user -r $REQUIREMENTS_FILE nose
- run:
name: Lint
command: pipenv run flake8
command: flake8 flask_mongorest
- run:
name: Test
command: pipenv run nosetests
command: nosetests

jobs:
test-2.7:
Expand Down
14 changes: 6 additions & 8 deletions flask_mongorest/views.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import json

import mimerender
import mongoengine

from flask import request, render_template
from werkzeug.exceptions import NotFound, Unauthorized

from flask import render_template, request
from flask.views import MethodView
from flask_mongorest import methods
from flask_mongorest.exceptions import ValidationError
from flask_mongorest.utils import MongoEncoder
from flask_mongorest import methods
from flask_views.base import View
from werkzeug.exceptions import NotFound, Unauthorized

mimerender = mimerender.FlaskMimeRender()

Expand Down Expand Up @@ -50,7 +49,7 @@ def serialize_errors(e):
else:
return {'error': get_exception_message(e)}

class ResourceView(View):
class ResourceView(MethodView):
resource = None
methods = []
authentication_methods = []
Expand Down Expand Up @@ -269,4 +268,3 @@ def has_change_permission(self, request, obj):

def has_delete_permission(self, request, obj):
return True

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ python-dateutil
sphinx
cleancat>=0.3
Flask>=0.9
Flask-Views
pymongo>=3.4
flake8
1 change: 0 additions & 1 deletion requirements3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mimerender
python-dateutil
sphinx
Flask>=0.9
Flask-Views
pymongo
flake8
flake8-bugbear
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
zip_safe=False,
platforms='any',
setup_requires=[
'Flask-Views',
'Flask-MongoEngine',
'mimerender',
'nose',
Expand Down

0 comments on commit 9a04099

Please sign in to comment.