Skip to content

Commit 289824b

Browse files
. r Add todo and comment out not yet accessed DB code
Co-Authored-By: Joel Silberman <42779942+jcs-instructor@users.noreply.github.com> Co-Authored-By: 4dsherwood <4dsherwood@users.noreply.github.com>
1 parent a60f2f4 commit 289824b

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed
-640 Bytes
Binary file not shown.

katas/fizzbuzz_with_db_2/fizzbuzz.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ def __init__(self, word, divisor):
77
self.word = word
88
self.divisor = divisor
99

10-
def get_rules_from_db(collection):
11-
# Fetches rules from MongoDB, sorted by the divisor in ascending order
12-
rules = []
13-
try:
14-
rules_data = collection.find({}).sort("divisor", 1) # Sorting by 'divisor' in ascending order
15-
for rule in rules_data:
16-
rules.append(Rule(rule['word'], rule['divisor']))
17-
except Exception as e:
18-
print(f"An error occurred while fetching rules from MongoDB: {e}")
19-
return rules
10+
# TODO: When implement DB logic.
11+
# def get_rules_from_db(collection):
12+
# # Fetches rules from MongoDB, sorted by the divisor in ascending order
13+
# rules = []
14+
# try:
15+
# rules_data = collection.find({}).sort("divisor", 1) # Sorting by 'divisor' in ascending order
16+
# for rule in rules_data:
17+
# rules.append(Rule(rule['word'], rule['divisor']))
18+
# except Exception as e:
19+
# print(f"An error occurred while fetching rules from MongoDB: {e}")
20+
# return rules
2021

2122
def fizz_buzz(i, rules=None):
2223
# TODO: Use default rules from MongoDB if no rules are specified

0 commit comments

Comments
 (0)