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):
1616 if self .db_column == "_id" :
1717 del kwargs ["db_column" ]
1818 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+ )
2022 return name , path , args , kwargs
2123
2224 def get_prep_value (self , value ):
@@ -33,7 +35,9 @@ def get_prep_value(self, value):
3335 # A manually assigned integer ID?
3436 if isinstance (value , str ) and value .isdigit ():
3537 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
3741
3842 def get_internal_type (self ):
3943 return "ObjectIdAutoField"
Original file line number Diff line number Diff line change @@ -47,7 +47,10 @@ class ObjectIdField(ObjectIdMixin, Field):
4747 def deconstruct (self ):
4848 name , path , args , kwargs = super ().deconstruct ()
4949 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+ )
5154 return name , path , args , kwargs
5255
5356 def get_internal_type (self ):
You can’t perform that action at this time.
0 commit comments