Skip to content

Commit 8d8077b

Browse files
committed
updated seed with generated tasks, and fixed priority colour bug
1 parent 49e4833 commit 8d8077b

2 files changed

Lines changed: 122 additions & 75 deletions

File tree

app/models/priority.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ class Priority(str, Enum):
99

1010
PRIORITY_COLOURS = {
1111
Priority.LOW: "text-green-700 bg-green-100",
12-
Priority.MEDIUM: "text-yellow-700 bg yellow-100",
12+
Priority.MEDIUM: "text-yellow-700 bg-yellow-100",
1313
Priority.HIGH: "text-red-700 bg-red-100"
1414
}

seed.py

Lines changed: 121 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -37,159 +37,206 @@
3737
db.session.commit()
3838

3939
task1 = Task(
40-
title="First task",
41-
description="Lorem ipsum dolor sit amet consectetur adipiscing",
42-
due_date=date.today() + timedelta(days=7),
43-
status=Status.TO_DO,
44-
priority=Priority.LOW,
45-
user_id=user1.id
46-
)
40+
title="Plan weekend trip",
41+
description="Research destinations, compare prices, and book accommodation for a short getaway.",
42+
due_date=date.today() + timedelta(days=7),
43+
status=Status.TO_DO,
44+
priority=Priority.MEDIUM,
45+
user_id=user1.id
46+
)
4747

4848
task2 = Task(
49-
title="Second task",
50-
description="Lorem ipsum dolor sit amet consectetur adipiscing elit quisque faucibus ex sapien vitae pellentesque sem placerat in id cursus mi.",
51-
due_date=date.today() + timedelta(days=3),
52-
status=Status.IN_PROGRESS,
53-
priority=Priority.HIGH,
54-
user_id=user1.id
55-
)
49+
title="Finish project report",
50+
description="Complete the final draft of the quarterly report and send it to the manager for review.",
51+
due_date=date.today() + timedelta(days=3),
52+
status=Status.IN_PROGRESS,
53+
priority=Priority.HIGH,
54+
user_id=user1.id
55+
)
5656

5757
task3 = Task(
58-
title="First task",
59-
description="Example task",
60-
due_date=date.today() + timedelta(days=7),
61-
status=Status.TO_DO,
62-
priority=Priority.LOW,
63-
user_id=user2.id
64-
)
58+
title="Grocery shopping",
59+
description="Buy essentials: milk, eggs, bread, vegetables, and snacks for the week.",
60+
due_date=date.today() + timedelta(days=7),
61+
status=Status.COMPLETED,
62+
priority=Priority.LOW,
63+
user_id=user2.id
64+
)
6565

6666
task4 = Task(
67-
title="Second task",
68-
description="Another task",
69-
due_date=date.today() + timedelta(days=3),
70-
status=Status.IN_PROGRESS,
71-
priority=Priority.HIGH,
72-
user_id=user2.id
73-
)
67+
title="Workout routine",
68+
description="Complete a 45-minute workout session focusing on cardio and strength training.",
69+
due_date=date.today() + timedelta(days=2),
70+
status=Status.IN_PROGRESS,
71+
priority=Priority.MEDIUM,
72+
user_id=user2.id
73+
)
7474

7575
task5 = Task(
76-
title="Third task",
77-
description="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text",
78-
due_date=date.today() + timedelta(days=7),
76+
title="Read a book",
77+
description="Read at least 3 chapters of the current book and take notes on key ideas.",
78+
due_date=date.today() + timedelta(days=6),
7979
status=Status.TO_DO,
8080
priority=Priority.LOW,
8181
user_id=user1.id
8282
)
8383

8484
task6 = Task(
85-
title="Fourth task",
86-
description="It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' ",
87-
due_date=date.today() + timedelta(days=3),
85+
title="Update portfolio website",
86+
description="Add recent projects, improve layout, and fix responsiveness issues on mobile devices.",
87+
due_date=date.today() + timedelta(days=4),
8888
status=Status.IN_PROGRESS,
8989
priority=Priority.HIGH,
9090
user_id=user1.id
9191
)
9292

9393
task7 = Task(
94-
title="Third task",
95-
description="Example task",
96-
due_date=date.today() + timedelta(days=7),
94+
title="Call family",
95+
description="Catch up with family members and check in on how everyone is doing.",
96+
due_date=date.today() + timedelta(days=5),
9797
status=Status.TO_DO,
9898
priority=Priority.LOW,
9999
user_id=user2.id
100100
)
101101

102102
task8 = Task(
103-
title="Fourth task",
104-
description="Another task",
105-
due_date=date.today() + timedelta(days=3),
103+
title="Clean apartment",
104+
description="Vacuum, dust surfaces, clean kitchen, and organize cluttered areas.",
105+
due_date=date.today() + timedelta(days=1),
106106
status=Status.IN_PROGRESS,
107-
priority=Priority.HIGH,
107+
priority=Priority.MEDIUM,
108108
user_id=user2.id
109109
)
110110

111111
task9 = Task(
112-
title="Fourth task",
113-
description="Another task",
114-
due_date=date.today() + timedelta(days=3),
112+
title="Prepare presentation slides",
113+
description="Create slides for the upcoming meeting, including visuals and key metrics.",
114+
due_date=date.today() + timedelta(days=2),
115115
status=Status.IN_PROGRESS,
116116
priority=Priority.HIGH,
117117
user_id=user1.id
118118
)
119119

120120
task10 = Task(
121-
title="Fourth task",
122-
description="Another task",
123-
due_date=date.today() + timedelta(days=3),
121+
title="Fix login bug",
122+
description="Investigate and resolve authentication issue affecting user sign-ins.",
123+
due_date=date.today() + timedelta(days=1),
124124
status=Status.IN_PROGRESS,
125125
priority=Priority.HIGH,
126126
user_id=user1.id
127127
)
128128

129129
task11 = Task(
130-
title="Fourth task",
131-
description="Another task",
132-
due_date=date.today() + timedelta(days=3),
133-
status=Status.IN_PROGRESS,
134-
priority=Priority.HIGH,
130+
title="Email client feedback",
131+
description="Respond to client questions and provide updates on requested changes.",
132+
due_date=date.today() + timedelta(days=2),
133+
status=Status.COMPLETED,
134+
priority=Priority.MEDIUM,
135135
user_id=user1.id
136136
)
137137

138138
task12 = Task(
139-
title="Fourth task",
140-
description="Another task",
141-
due_date=date.today() + timedelta(days=3),
142-
status=Status.IN_PROGRESS,
139+
title="Backup database",
140+
description="Run a full backup and verify data integrity for the production database.",
141+
due_date=date.today() + timedelta(days=1),
142+
status=Status.TO_DO,
143143
priority=Priority.HIGH,
144144
user_id=user1.id
145145
)
146146

147147
task13 = Task(
148-
title="Fourth task",
149-
description="Another task",
150-
due_date=date.today() + timedelta(days=3),
148+
title="Team meeting prep",
149+
description="Review agenda, gather updates, and prepare talking points for the weekly sync.",
150+
due_date=date.today() + timedelta(days=2),
151151
status=Status.IN_PROGRESS,
152-
priority=Priority.HIGH,
152+
priority=Priority.MEDIUM,
153153
user_id=user1.id
154154
)
155155

156156
task14 = Task(
157-
title="Fourth task",
158-
description="Another task",
159-
due_date=date.today() + timedelta(days=3),
160-
status=Status.IN_PROGRESS,
157+
title="Refactor API endpoints",
158+
description="Improve code structure, reduce duplication, and optimize response times.",
159+
due_date=date.today() + timedelta(days=5),
160+
status=Status.TO_DO,
161161
priority=Priority.HIGH,
162162
user_id=user1.id
163163
)
164164

165165
task15 = Task(
166-
title="Fourth task",
167-
description="Another task",
168-
due_date=date.today() + timedelta(days=3),
166+
title="Write unit tests",
167+
description="Increase test coverage for critical modules and fix failing test cases.",
168+
due_date=date.today() + timedelta(days=4),
169169
status=Status.IN_PROGRESS,
170170
priority=Priority.HIGH,
171171
user_id=user1.id
172172
)
173173

174174
task16 = Task(
175-
title="Fourth task",
176-
description="Another task",
177-
due_date=date.today() + timedelta(days=3),
175+
title="Plan next sprint",
176+
description="Define goals, prioritize backlog items, and allocate tasks to the team.",
177+
due_date=date.today() + timedelta(days=6),
178+
status=Status.TO_DO,
179+
priority=Priority.MEDIUM,
180+
user_id=user1.id
181+
)
182+
183+
task17 = Task(
184+
title="Review pull requests",
185+
description="Go through open PRs, leave feedback, and approve changes where appropriate.",
186+
due_date=date.today() + timedelta(days=1),
178187
status=Status.IN_PROGRESS,
179188
priority=Priority.HIGH,
180189
user_id=user1.id
181190
)
182191

183-
task17 = Task(
184-
title="Fourth task",
185-
description="Another task",
192+
# --- New tasks for user1 to reach 20 total ---
193+
194+
task18 = Task(
195+
title="Optimize database queries",
196+
description="Analyze slow queries and add indexing to improve performance.",
186197
due_date=date.today() + timedelta(days=3),
187198
status=Status.IN_PROGRESS,
188199
priority=Priority.HIGH,
189200
user_id=user1.id
190201
)
191202

192-
db.session.add_all([task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13, task14, task15, task16, task17])
203+
task19 = Task(
204+
title="Write documentation",
205+
description="Document API endpoints and usage examples for developers.",
206+
due_date=date.today() + timedelta(days=7),
207+
status=Status.TO_DO,
208+
priority=Priority.MEDIUM,
209+
user_id=user1.id
210+
)
211+
212+
task20 = Task(
213+
title="Set up CI/CD pipeline",
214+
description="Configure automated testing and deployment workflow.",
215+
due_date=date.today() + timedelta(days=5),
216+
status=Status.TO_DO,
217+
priority=Priority.HIGH,
218+
user_id=user1.id
219+
)
220+
221+
task21 = Task(
222+
title="Research new tech stack",
223+
description="Explore potential frameworks and tools for the next project.",
224+
due_date=date.today() + timedelta(days=8),
225+
status=Status.TO_DO,
226+
priority=Priority.LOW,
227+
user_id=user1.id
228+
)
229+
230+
task22 = Task(
231+
title="Monitor application logs",
232+
description="Check logs for errors and unusual activity in production.",
233+
due_date=date.today() + timedelta(days=1),
234+
status=Status.COMPLETED,
235+
priority=Priority.MEDIUM,
236+
user_id=user1.id
237+
)
238+
239+
db.session.add_all([task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13, task14, task15, task16, task17, task18, task19, task20, task21, task22])
193240
db.session.commit()
194241

195242
print("Database seeded.")

0 commit comments

Comments
 (0)