One option would to fall back to the current sync_to_async
behavior when we don’t have an async connection, emitting a PendingDeprecationWarning
.
Something like:
class QuerySet:
....
async def aexists(self):
try:
return await <async_implentation>
except MissingAsyncConnection:
warnings.warn("...")
return await sync_to_async(self.exists)()