File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -379,6 +379,12 @@ class Meta:
379379 verbose_name_plural = "document histories"
380380
381381def save_document_in_history (doc ):
382+ """This should be called before saving changes to a Document instance,
383+ so that the DocHistory entries contain all previous states, while
384+ the Group entry contain the current state. XXX TODO: Call this
385+ directly from Document.save(), and add event listeners for save()
386+ on related objects so we can save as needed when they change, too.
387+ """
382388 def get_model_fields_as_dict (obj ):
383389 return dict ((field .name , getattr (obj , field .name ))
384390 for field in obj ._meta .fields
Original file line number Diff line number Diff line change 66
77
88def save_group_in_history (group ):
9+ """This should be called before saving changes to a Group instance,
10+ so that the GroupHistory entries contain all previous states, while
11+ the Group entry contain the current state. XXX TODO: Call this
12+ directly from Group.save()
13+ """
914 def get_model_fields_as_dict (obj ):
1015 return dict ((field .name , getattr (obj , field .name ))
1116 for field in obj ._meta .fields
You can’t perform that action at this time.
0 commit comments