parent
a536097804
commit
0479bea40b
@ -946,12 +946,11 @@ class FileField(BaseField):
|
|||||||
|
|
||||||
# Check if a file already exists for this model
|
# Check if a file already exists for this model
|
||||||
grid_file = instance._data.get(self.name)
|
grid_file = instance._data.get(self.name)
|
||||||
self.grid_file = grid_file
|
if isinstance(grid_file, self.proxy_class):
|
||||||
if isinstance(self.grid_file, self.proxy_class):
|
if not grid_file.key:
|
||||||
if not self.grid_file.key:
|
grid_file.key = self.name
|
||||||
self.grid_file.key = self.name
|
grid_file.instance = instance
|
||||||
self.grid_file.instance = instance
|
return grid_file
|
||||||
return self.grid_file
|
|
||||||
return self.proxy_class(key=self.name, instance=instance,
|
return self.proxy_class(key=self.name, instance=instance,
|
||||||
db_alias=self.db_alias,
|
db_alias=self.db_alias,
|
||||||
collection_name=self.collection_name)
|
collection_name=self.collection_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user