While the file saving works, the settings do not. The settings menu items should work as expected, remaining checked or unchecked, but they don't yet change the behavior of the data entry form. Let's make this work.
Recall that both autofill features are implemented in the DataRecordForm class's reset() method. To use our new settings, we need to give our form access to the settings dictionary by performing the following steps:
- Open views.py and update the DataRecordForm.__init__() method as follows:
def __init__(self, parent, fields, settings, *args, **kwargs):
super().__init__(parent, *args, **kwargs)
self.settings = settings
- We've added an additional positional argument, settings, and then set that to self.settings so that all of the methods in the class can access it. Now, look at the reset() method; currently...