Skip to content

Commit 7d9cdc9

Browse files
author
Colton Provias
committed
Get rid of the annoying params dict.
1 parent c79c2b0 commit 7d9cdc9

File tree

6 files changed

+156
-237
lines changed

6 files changed

+156
-237
lines changed

CHANGES.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# SQLAlchemy-JSONAPI Changelog
22

3-
## 1.0.1 - Fixes for 1.0 Compatibility
3+
## 2.0.0 - Interface Fix
44

5-
*In Development*
5+
*2015-08-29*
6+
7+
* BREAKING Replaced dict params with api_type, obj_id, and rel_key
68

79
## 1.0.0 - Start of 1.0 Compatibility
810

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from setuptools import setup
1414

1515
setup(name='SQLAlchemy-JSONAPI',
16-
version='1.0.1',
16+
version='2.0.0',
1717
url='http://github.com/coltonprovias/sqlalchemy-jsonapi',
1818
license='MIT',
1919
author='Colton J. Provias',

sqlalchemy_jsonapi/flask.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,17 @@ def new_view(**kwargs):
177177
}
178178
results = self.on_request.send(self, **event_kwargs)
179179
data = override(data, results)
180+
181+
args = [self.sqla.session, data, kwargs['api_type']]
182+
if 'obj_id' in kwargs.keys():
183+
args.append(kwargs['obj_id'])
184+
if 'relationship' in kwargs.keys():
185+
args.append(kwargs['relationship'])
186+
180187
try:
181188
attr = '{}_{}'.format(method.name, endpoint.name).lower()
182189
handler = getattr(self.serializer, attr)
183-
response = handler(self.sqla.session, data, kwargs)
190+
response = handler(*args)
184191
results = self.on_success.send(self,
185192
response=response,
186193
**event_kwargs)

0 commit comments

Comments
 (0)