File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ def get_instance(self):
217
217
('~' , 'Changed' ),
218
218
('-' , 'Deleted' ),
219
219
)),
220
- 'history_object' : HistoricalObjectDescriptor (model ),
220
+ 'history_object' : HistoricalObjectDescriptor (model , self . fields_included ( model ) ),
221
221
'instance' : property (get_instance ),
222
222
'instance_type' : model ,
223
223
'revert_url' : revert_url ,
@@ -311,10 +311,11 @@ def convert_auto_field(field):
311
311
312
312
313
313
class HistoricalObjectDescriptor (object ):
314
- def __init__ (self , model ):
314
+ def __init__ (self , model , fields_included ):
315
315
self .model = model
316
+ self .fields_included = fields_included
316
317
317
318
def __get__ (self , instance , owner ):
318
319
values = (getattr (instance , f .attname )
319
- for f in self .model . _meta . fields )
320
+ for f in self .fields_included )
320
321
return self .model (* values )
You can’t perform that action at this time.
0 commit comments