Fixed the issue of len not working with the result of db query. by anandology · Pull Request #554 · webpy/webpy · GitHub
Skip to content

Fixed the issue of len not working with the result of db query.#554

Merged
iredmail merged 2 commits into
webpy:masterfrom
anandology:db-len
Sep 27, 2019
Merged

Fixed the issue of len not working with the result of db query.#554
iredmail merged 2 commits into
webpy:masterfrom
anandology:db-len

Conversation

@anandology

Copy link
Copy Markdown
Member

The earlier implentation was adding an len function to the result
object and that worked fine for old-style classes. With old-style
classes gone in Python 3, that started giving trouble. Fixed it by
writing a ResultSet class and a special SqliteResultSet which doesn't
support len, but supports bool.

Fixes #547.

The earlier implentation was adding an __len__ function to the result
object and that worked fine for old-style classes. With old-style
classes gone in Python 3, that started giving trouble. Fixed it by
writing a ResultSet class and a special SqliteResultSet which doesn't
support len, but supports bool.

Fixes webpy#547.
@iredmail iredmail merged commit fa27cc5 into webpy:master Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

len doesn't work on query result

2 participants