File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
import contextlib
2
+ from importlib import metadata
2
3
3
4
from django .core .exceptions import ImproperlyConfigured
4
5
from django .db .backends .base .base import BaseDatabaseWrapper
5
6
from pymongo .collection import Collection
7
+ from pymongo .driver_info import DriverInfo
6
8
from pymongo .mongo_client import MongoClient
7
9
8
10
from . import dbapi as Database
@@ -170,7 +172,10 @@ def get_connection_params(self):
170
172
}
171
173
172
174
def get_new_connection (self , conn_params ):
173
- return MongoClient (** conn_params )
175
+ return MongoClient (** conn_params , driver = self ._driver_info ())
176
+
177
+ def _driver_info (self ):
178
+ return DriverInfo ("django-mongodb" , metadata .version ("django-mongodb" ))
174
179
175
180
def _commit (self ):
176
181
pass
You can’t perform that action at this time.
0 commit comments