Skip to content

Commit

Permalink
Merge pull request #28 from dgelvin/master
Browse files Browse the repository at this point in the history
Fix for Proxy database support
  • Loading branch information
rudyryk committed May 28, 2016
2 parents ee93457 + b65b4d1 commit 90e80a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion peewee_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ def _swap_database(self, query):
If query database can't be swapped and differs from manager's
database, it's **WRONG AND DANGEROUS**, so assertion is raised.
"""
if query.database == self.database:
if query.database == self.database or \
(isinstance(query.database, peewee.Proxy) and
query.database.obj == self.database):
return query
elif self._subclassed(peewee.PostgresqlDatabase,
query.database,
Expand Down

0 comments on commit 90e80a4

Please sign in to comment.