
__init__.py
About this file
Constants are set in advance so that if some variable value which is being
used at various locations has to be changed, it can be changed at just
one place.
It is better to define them at one place to avoid problems during such
incidents of value change.
This file contains constants for acknowledgments, categories, states,
default expirations, email templates, OpenRecords email, and confirmation headers.
This file imports values from response_type, determination_type and event_type.
Email templates have constants for the types of events, for request
responses, and the creation of determination letters.
Code Issues
-
The good thing about constants files is that whenever there is a need to
change a constant value which is being used in many files, it can be just
changed at one place and it gets reflected everywhere.
Most of the constants are self explanatory as defined by the file names
itself.
Example:
communication_methods.py
has constants EMAIL and LETTER defined as means of communication.
But, it is always better to have an overview of what kind of constants are defined in a particular file specifically when there are more than 10 files defined just for constants. It becomes easier to navigate through the files and find the constant needed. -
There are a lot of docstrings missing even though there are
”triple double quotes” in files like
bulk_updates.py
anduser_attrs.py
.
It would be better if there is a summary in the docstrings because these files have various classes defined without any explanation. Also, these classes have pretty much similar functioning.
Example:
In filebulk_updates.py
the 3 classes areclass UserRequestsDict()
,class UserRequestsEventDict()
andclass EventsDict()
.
The classes are very similar with few differences in the parameters.
Code Check Report
app/constants/__init__.py:123:2: W292 no newline at end of file
Documentation drawn from source code