Skip to content

Commit

Permalink
Merge pull request #4 from Kozea/support-sqlalchemy1.4
Browse files Browse the repository at this point in the history
Support sqlalchemy1.4
  • Loading branch information
cmigazzi committed Jul 7, 2021
2 parents 981de31 + 21dd8ec commit 4e953b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -40,7 +40,7 @@
'flask',
'flask-sqlalchemy',
'tornado',
'sanic',
'sanic<21',
'aiohttp',
'pyyaml',
]
Expand Down
8 changes: 4 additions & 4 deletions unrest/rest.py
Expand Up @@ -526,10 +526,10 @@ def serialize_all(self, items):

if isinstance(items, Query):
rv['occurences'] = items.offset(None).limit(None).count()
if items._offset is not None:
rv['offset'] = items._offset
if items._limit is not None:
rv['limit'] = items._limit
if items.selectable._offset is not None:
rv['offset'] = items.selectable._offset
if items.selectable._limit is not None:
rv['limit'] = items.selectable._limit

rv['objects'] = [self.serialize(item) for item in items]
if 'occurences' not in rv:
Expand Down

0 comments on commit 4e953b4

Please sign in to comment.