-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Edit Displayed Text in Bug List Filters Fix (#13)
* - issue #1 - used constants for the text displayed in filters * - added a util function to get actual value from list of tuples. * Update utils.py - Simplify the function get_choice_display() - Improve function docstring - Add module docstring --------- Co-authored-by: Niloth P <[email protected]>
- Loading branch information
1 parent
2fc8b25
commit af2b062
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
""" | ||
Utility Functions | ||
This module contains utility functions that are not tied to specific Django models or views. | ||
These functions provide common functionality that can be reused across different parts of the project. | ||
""" | ||
def get_choice_display(choices, choice_key): | ||
""" | ||
Get the display value for a choice key. | ||
Args: | ||
choices (list of tuple): The list of choices. | ||
choice_key (str): The key of the choice. | ||
Returns: | ||
str: The display value for the choice. | ||
""" | ||
return dict(choices).get(choice_key, "All") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters