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

Commit

Permalink
Merge pull request #77 from lendingblock/master
Browse files Browse the repository at this point in the history
0.5.5
  • Loading branch information
daniloaf authored Aug 6, 2018
2 parents 01739f6 + 319dd61 commit ea65c2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion openapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Minimal OpenAPI asynchronous server application
"""

__version__ = '0.5.4'
__version__ = '0.5.5'
10 changes: 6 additions & 4 deletions openapi/db/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,22 @@ async def create_one(
return self.dump(dump_schema, values[0])

async def create_list(
self, *, data=None, dump_schema='response_schema', conn=None
self, *, data=None, table=None, body_schema='body_schema',
dump_schema='response_schema', conn=None
):
"""Create multiple models
"""
table = table if table is not None else self.db_table
if data is None:
data = await self.json_data()
if not isinstance(data, list):
raise web.HTTPBadRequest(
**self.api_response_data({'message': 'Invalid JSON payload'})
)
data = [self.insert_data(d) for d in data]
data = [self.insert_data(d, body_schema=body_schema) for d in data]

async with self.ensure_connection(conn) as conn:
statement, args = self.get_insert(data)
statement, args = self.get_insert(data, table=table)
values = await conn.fetch(statement, *args)

return self.dump(dump_schema, values)
Expand All @@ -124,7 +126,7 @@ async def get_one(

async def update_one(
self, *, data=None, filters=None, table=None,
dump_schema='response_schema', conn=None
body_schema='body_schema', dump_schema='response_schema', conn=None
):
"""Update a single model
"""
Expand Down

0 comments on commit ea65c2b

Please sign in to comment.