File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
django_mongodb_backend/fields Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ def deconstruct(self):
16
16
if self .db_column == "_id" :
17
17
del kwargs ["db_column" ]
18
18
if path .startswith ("django_mongodb_backend.fields.auto" ):
19
- path = path .replace ("django_mongodb_backend.fields.auto" , "django_mongodb_backend.fields" )
19
+ path = path .replace (
20
+ "django_mongodb_backend.fields.auto" , "django_mongodb_backend.fields"
21
+ )
20
22
return name , path , args , kwargs
21
23
22
24
def get_prep_value (self , value ):
@@ -33,7 +35,9 @@ def get_prep_value(self, value):
33
35
# A manually assigned integer ID?
34
36
if isinstance (value , str ) and value .isdigit ():
35
37
return int (value )
36
- raise ValueError (f"Field '{ self .name } ' expected an ObjectId but got { value !r} ." ) from e
38
+ raise ValueError (
39
+ f"Field '{ self .name } ' expected an ObjectId but got { value !r} ."
40
+ ) from e
37
41
38
42
def get_internal_type (self ):
39
43
return "ObjectIdAutoField"
Original file line number Diff line number Diff line change @@ -47,7 +47,10 @@ class ObjectIdField(ObjectIdMixin, Field):
47
47
def deconstruct (self ):
48
48
name , path , args , kwargs = super ().deconstruct ()
49
49
if path .startswith ("django_mongodb_backend.fields.objectid" ):
50
- path = path .replace ("django_mongodb_backend.fields.objectid" , "django_mongodb_backend.fields" )
50
+ path = path .replace (
51
+ "django_mongodb_backend.fields.objectid" ,
52
+ "django_mongodb_backend.fields" ,
53
+ )
51
54
return name , path , args , kwargs
52
55
53
56
def get_internal_type (self ):
You can’t perform that action at this time.
0 commit comments