Skip to content

Commit

Permalink
Merge pull request ColtonProvias#33 from deryckh/revert-to-clean-state
Browse files Browse the repository at this point in the history
Revert partial implementation of query params
  • Loading branch information
Anderycks authored Feb 10, 2017
2 parents 223d144 + 3c59683 commit f5ce867
Show file tree
Hide file tree
Showing 36 changed files with 959 additions and 1,471 deletions.
3 changes: 1 addition & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# SQLAlchemy-JSONAPI Changelog

## 5.0.0
## 4.0.9

*Unreleased*

* BREAKING: The query data is now expected for all endpoints
* Fixed bug during testing in delete_relationship where returned resource was missing data key
* Fixed bug during testing in patch_resource where field check was failing

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

[![Build Status](https://travis-ci.org/ColtonProvias/sqlalchemy-jsonapi.svg?branch=master)](https://travis-ci.org/ColtonProvias/sqlalchemy-jsonapi)

**WARNING: The master branch is currently breaking backwards compatibility and thus has been bumped to 5.0.0. Builds are likely to fail during 5.0.0 development.**

[JSON API](http://jsonapi.org/) implementation for use with
[SQLAlchemy](http://www.sqlalchemy.org/).

Expand Down
11 changes: 0 additions & 11 deletions docs/constants.rst

This file was deleted.

46 changes: 1 addition & 45 deletions docs/errors.rst
Original file line number Diff line number Diff line change
@@ -1,47 +1,3 @@
======
Errors
======

.. currentmodule:: sqlalchemy_jsonapi.errors

.. autoclass:: BaseError
:members:

.. autoclass:: BadRequestError
:members:

.. autoclass:: NotAnAttributeError
:members:

.. autoclass:: NotSortableError
:members:

.. autoclass:: PermissionDeniedError
:members:

.. autoclass:: InvalidTypeForEndpointError
:members:

.. autoclass:: MissingTypeError
:members:

.. autoclass:: MissingContentTypeError
:members:

.. autoclass:: ValidationError
:members:

.. autoclass:: ResourceNotFoundError
:members:

.. autoclass:: RelatedResourceNotFoundError
:members:

.. autoclass:: RelationshipNotFoundError
:members:

.. autoclass:: ToManyExpectedError
:members:

.. autoclass:: ResourceTypeNotFoundError
:members:
======
2 changes: 1 addition & 1 deletion docs/flask.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Flask
=====

.. currentmodule:: sqlalchemy_jsonapi.flaskext
.. currentmodule:: sqlalchemy_jsonapi.flask

To those who use Flask, setting up SQLAlchemy-JSONAPI can be extremely complex
and frustrating. Let's look at an example::
Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Contents:
serializer
flask
errors
constants


Indices and tables
Expand Down
7 changes: 1 addition & 6 deletions docs/serializer.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
==========
Serializer
==========

.. currentmodule:: sqlalchemy_jsonapi.serializer

.. autoclass:: JSONAPI
:members:
==========
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# pip-compile --output-file requirements.txt requirements.in
#

bcrypt==2.0.0
blinker==1.4
cffi==1.7.0 # via bcrypt
Expand Down
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@

from setuptools import setup
import sys
import ast

requirements = ['SQLAlchemy', 'inflection']

with open('sqlalchemy_jsonapi/_version.py', 'r') as f:
version = ast.parse(f.read()).body[0].value.s

if sys.version_info[0] != 3 or sys.version_info[1] < 4:
requirements.append('enum34')
requirements.append('enum34')

setup(name='SQLAlchemy-JSONAPI',
version=version,
version='4.0.9',
url='http://github.com/coltonprovias/sqlalchemy-jsonapi',
license='MIT',
author='Colton J. Provias',
Expand Down
3 changes: 1 addition & 2 deletions sqlalchemy_jsonapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
AttributeActions, Permissions, RelationshipActions,
attr_descriptor, permission_test,
relationship_descriptor)
from ._version import __version__

try:
from .flaskext import FlaskJSONAPI
except ImportError:
FlaskJSONAPI = None
FlaskJSONAPI = None
1 change: 0 additions & 1 deletion sqlalchemy_jsonapi/_version.py

This file was deleted.

3 changes: 2 additions & 1 deletion sqlalchemy_jsonapi/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
MIT License
"""


try:
from enum import Enum
except ImportError:
Expand All @@ -26,4 +27,4 @@ class Endpoint(Enum):
COLLECTION = '/<api_type>'
RESOURCE = '/<api_type>/<obj_id>'
RELATED = '/<api_type>/<obj_id>/<relationship>'
RELATIONSHIP = '/<api_type>/<obj_id>/relationships/<relationship>'
RELATIONSHIP = '/<api_type>/<obj_id>/relationships/<relationship>'
10 changes: 3 additions & 7 deletions sqlalchemy_jsonapi/flaskext.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@ def _setup_adapter(self, namespace, route_prefix):
:param namespace: Prefix for generated endpoints
:param route_prefix: Prefix for route patterns
"""
self.serializer = JSONAPI(self.sqla.Model,
prefix='{}://{}{}'.format(
self.app.config['PREFERRED_URL_SCHEME'],
self.app.config['SERVER_NAME'],
route_prefix))
self.serializer = JSONAPI(self.sqla.Model, prefix='{}://{}{}'.format(self.app.config['PREFERRED_URL_SCHEME'], self.app.config['SERVER_NAME'], route_prefix))
for view in views:
method, endpoint = view
pattern = route_prefix + endpoint.value
Expand Down Expand Up @@ -224,8 +220,8 @@ def new_view(**kwargs):
try:
attr = '{}_{}'.format(method.name, endpoint.name).lower()
handler = getattr(self.serializer, attr)
handler_chain = list(self._handler_chains.get((kwargs[
'api_type'], method, endpoint), []))
handler_chain = list(self._handler_chains.get((
kwargs['api_type'], method, endpoint), []))
handler_chain.append(handler)
chained_handler = self._call_next(handler_chain)
response = chained_handler(*args)
Expand Down
Loading

0 comments on commit f5ce867

Please sign in to comment.