Create general autofill table and category util functions. Update table class to have get categories function.
This commit is contained in:
@@ -123,6 +123,16 @@ class Table:
|
||||
if category.name not in self._categories_map:
|
||||
self._categories_map[category.name] = category
|
||||
|
||||
def get_categories(self) -> dict:
|
||||
"""
|
||||
Getter for dict of category names and categories.
|
||||
|
||||
Returns:
|
||||
dict: Dictionary consisting of Category names and Category objects.
|
||||
"""
|
||||
# I don't know if this is const data. Don't want to allow data to be written as a result of this function.
|
||||
return self._categories_map
|
||||
|
||||
def get_category(self, category_name: str) -> Category:
|
||||
"""
|
||||
Getter for specific category. Returns None if not found.
|
||||
|
||||
Reference in New Issue
Block a user