Skip to content

Commit 618670f

Browse files
PeteCowardRoss Mechanic
authored andcommitted
Instantiate model with kwargs not args to allow for excluded fields (#585)
1 parent f3d7afe commit 618670f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

simple_history/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ def __init__(self, model, fields_included):
558558
self.fields_included = fields_included
559559

560560
def __get__(self, instance, owner):
561-
values = (getattr(instance, f.attname) for f in self.fields_included)
562-
return self.model(*values)
561+
values = {f.attname: getattr(instance, f.attname) for f in self.fields_included}
562+
return self.model(**values)
563563

564564

565565
class HistoricalChanges(object):

0 commit comments

Comments
 (0)