Skip to content

4th PR: Calendar Events Model#128

Merged
aviendha-andrus merged 4 commits intomainfrom
calendar_events_model
Apr 12, 2025
Merged

4th PR: Calendar Events Model#128
aviendha-andrus merged 4 commits intomainfrom
calendar_events_model

Conversation

@aviendha-andrus
Copy link
Contributor

@aviendha-andrus aviendha-andrus commented Apr 7, 2025

Calendar Events Model

Added models and API endpoints for calendar events


Overview

What does this PR do?

This PR introduces a fully functional Calendar model feature to LessonConnect, allowing users to create events. The calendar supports different types of events including lessons, meetingss, reminders, and practice/study sessions.


Key Features & Changes

What has been added or changed?

Example:

  • Introduced a Calendar events model that includes all neccisary components of an event including title, date, start_time, end_time, and description.
  • Introduced a feature that allows events to be linked to assignments.
  • Insured workability using the admin panel to test the models and testing the endpoints using CURL

Why This Is Needed

What problem does this solve?

A flexible calendar is a neccisary component of LessonConnet, so that parents, students, and teachers can stay in the loop and on top of events and assignments.


Related Issue

🔗 This PR closes #100


Implementation Details

How was this feature developed?

  • Django REST Framework: Implemented ViewSets for all CRUD operations with proper authentication and permissions

Design Documentation (If Applicable)

Diagrams & Visuals

Screenshot 2025-04-11 at 9 31 46 PM

How to Test This PR

Step-by-step testing guide

1️⃣ Acquire an access token: To do this, migrate and run the server like usual (python manage runserver). Then go to http://127.0.0.1:8000/api/token/ via the browser. Sign in with your superuser account info and copy your access token.
2️⃣ Keep the server running in one terminal.
3️⃣ Note this must be done in another separate (not in the virtual environment) terminal. Paste access token into curl commands that test lesson-related API.
4️⃣ Fill in any desired API endpoint Fields, some being required while others not (and some being avoided more will be listed out in follow-up PR).
5️⃣ Outputs will be in the second (not in the virtual environment) terminal.


Files Added/Modified

📂 List of important files changed in this PR

File Name Description
models.py Calendar related models
serializers.py REST API serializers
views.py (views) API endpoints
urls.py URL routing for API endpoints
backend/urls.py Added lessons URL routing for new endpoints
admin.py to use the admin panel
managers.py to implement endpoints

AI Code Usage

🤖 Was AI-generated code used in this PR?

  • Yes
  • No

Checklist for Reviewers

Things to check before approving this PR:

  • Does the feature work as expected?
  • Are the UI and animations smooth?
  • Do the session buttons and controls function properly?
  • Is the code clean, modular, and well-documented?
  • Does the feature work on different screen sizes (desktop, mobile, tablet)?

Next Steps & Future Enhancements

What improvements can be made after merging?

  • Implement tests for the models and endpoints in tests.py in a future PR

Final Notes

Thank you for reviewing! Please leave feedback if you have any suggestions or concerns. Let’s make this feature even better!

ChrisCRL
ChrisCRL previously approved these changes Apr 8, 2025
Copy link
Contributor

@ChrisCRL ChrisCRL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Peer Review: Calendar Event Model Implementation

Hey Aviendha👋 — just finished reviewing your PR. Here's my feedback:

✅ What Looks Great

  • The model structure has been implemented cleanly.
  • Your event type choices are well-organized using class constants.

💡 Suggestions for Improvement (if any)

  • Consider adding date validation in the clean method to make sure events aren't scheduled in the past.
  • Maybe add a location field. And a field to see if it's a virtual meeting or not.
  • For the event_type field, consider whether it should really allow null/blank values when it has a default.

🧪 Tested This Feature

I ran the following test steps:

  • ✅ Verified model structure and field definitions.
  • ✅ Confirmed relationship with Assignment model.

🚀 Final Thoughts

Besides the suggestions I made, lgtm 👍 approved :)

@aviendha-andrus aviendha-andrus force-pushed the calendar_events_model branch from 24f8177 to 52bc446 Compare April 9, 2025 06:30
@aviendha-andrus
Copy link
Contributor Author

Thank you for your input! I added the clean method, and the location and virtual fields as suggested.

Copy link
Contributor

@omgdory omgdory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approval Overview

Managers added and serve to be really useful. Migrations created. Models make sense, serializers added for data formatting, and URL successfully handled. Views are very succinct and utilize pre-existing Django viewsets, particularly ModelViewSet, meaning that functionality aligns with existing Django methods and documentation. Settings updated to register this as an app. Overall, looks good! All that remains are tests.

🧠 Details

The introduction of the planner application, along with its models and associated views, enriches the functionality of the LessonConnect. The models are well-structured, capturing essential data (titles, dates, times, etc.). This lays the groundwork for a robust event management system within the application.

The addition of CRUD API endpoints demonstrates a clear understanding of RESTful principles and enhances the application's interactivity.

The implementation of features such as virtual event handling and the inclusion of a clean method to validate event data helps ensure data integrity. These features improve the user experience and contribute to the maintainability of the source code.

🎯 Next Steps

Although manual checking via the admin panel and using CURL work, it is important to add automatic tests to ensure that the CI/CD pipeline updates relative to these additional models. As discussed, these tests can be created in a separate PR. As it stands, this looks good to merge, and pre-existing functionality does not seem to have been affected. Great work!

@omgdory omgdory requested a review from ChrisCRL April 11, 2025 19:48
Copy link
Contributor

@ChrisCRL ChrisCRL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding my suggestions! Everything looks good to me. Approved 👍

@FrankFurter123
Copy link
Contributor

FrankFurter123 commented Apr 12, 2025

Hey @aviendha-andrus

Great work, just what we needed for our calendar to function properly! I know Abdul has already designed a good-looking calendar on the frontend, and I love the fact that you’ve provided a clear step-by-step guide on how test your work. It’s super helpful for integration.

I also appreciate that @AbdulAlharbi has already structured his code to expect where this should connect, so no need to worry about the design being affected. When it’s time to hook everything up, this should align perfectly with our MVP goals and be a strong addition for the presentation.

Amazing job, @aviendha-andrus ! If you plan on connecting this to the backend in your upcoming PRs, make sure to reach out to @AbdulAlharbi —he can definitely help smooth out the integration process.

  • Franklin

@AbdulAlharbi
Copy link
Contributor

Hey @aviendha-andrus

Just wanted to say how proud I am of the work you’ve done here. This backend implementation is exactly the kind of thoughtful, flexible design we need for LessonConnect to grow into a truly functional platform. You’ve covered both the essentials and future considerations beautifully.

I especially appreciate how clearly you outlined the setup steps and testing approach—it’s going to make front-end integration smooth sailing. As PM, it's always a joy to see this level of clarity, coordination, and quality in our core features. This lays a rock-solid foundation for what’s coming next.

Excited to see this come together with the frontend! Amazing job!

Abdul

@ashley-arellano
Copy link
Contributor

Hi @aviendha-andrus

This is a great addition to LessonConnect. Thank you for completing your task and getting this implementation done : D

This model is very important towards making progress on the calendar functionality. The instructions you provided on how to test your model is clear and easy to follow. Furthermore, I love how well you documented everything about your implementation so that in the future it'll be easy for us to use in case we want to add more to it.

Looking forward to seeing how this continues to evolve, especially once tests are added in the follow-up. Great work!!

@aviendha-andrus aviendha-andrus changed the title Calendar Events Model 4th PR: Calendar Events Model Apr 12, 2025
@aviendha-andrus
Copy link
Contributor Author

Hey @aviendha-andrus

Great work, just what we needed for our calendar to function properly! I know Abdul has already designed a good-looking calendar on the frontend, and I love the fact that you’ve provided a clear step-by-step guide on how test your work. It’s super helpful for integration.

I also appreciate that @AbdulAlharbi has already structured his code to expect where this should connect, so no need to worry about the design being affected. When it’s time to hook everything up, this should align perfectly with our MVP goals and be a strong addition for the presentation.

Amazing job, @aviendha-andrus ! If you plan on connecting this to the backend in your upcoming PRs, make sure to reach out to @AbdulAlharbi —he can definitely help smooth out the integration process.

  • Franklin

Hi @FrankFurter123!
Thank you for looking over this! I'm definitely planning to connect this to the backend in my upcoming PRs, and I’ll be sure to reach out to @AbdulAlharbi to help with the integration. I'm really happy to be working on something so fundamental to LessonConnect, and it's exciting to see how it’s all coming together. Looking forward to contributing more as we keep building toward the MVP!

@aviendha-andrus
Copy link
Contributor Author

Hey @aviendha-andrus

Just wanted to say how proud I am of the work you’ve done here. This backend implementation is exactly the kind of thoughtful, flexible design we need for LessonConnect to grow into a truly functional platform. You’ve covered both the essentials and future considerations beautifully.

I especially appreciate how clearly you outlined the setup steps and testing approach—it’s going to make front-end integration smooth sailing. As PM, it's always a joy to see this level of clarity, coordination, and quality in our core features. This lays a rock-solid foundation for what’s coming next.

Excited to see this come together with the frontend! Amazing job!

Abdul

Hi @AbdulAlharbi
Thank you so much! I’m really grateful for your implementation of the frontend calendar, it looks really good! I’m looking forward to seeing this feature come together through integration. I’ll definitely reach out as I get started on hooking things up. It’s awesome to be working on something so central to LessonConnect’s purpose. Super excited for what’s ahead!

@aviendha-andrus
Copy link
Contributor Author

Hi @aviendha-andrus

This is a great addition to LessonConnect. Thank you for completing your task and getting this implementation done : D

This model is very important towards making progress on the calendar functionality. The instructions you provided on how to test your model is clear and easy to follow. Furthermore, I love how well you documented everything about your implementation so that in the future it'll be easy for us to use in case we want to add more to it.

Looking forward to seeing how this continues to evolve, especially once tests are added in the follow-up. Great work!!

Hi @ashley-arellano,
Thank you for creating the issue that this PR was based off of! I’m happy that this PR fits in with the vision you had for this issue. The feedback means a lot, especially considering how fundamental the calendar feature is and how many other people will be working on this feature. I’m glad to see that my code is readable for my teammates.

@EthanZ23
Copy link
Contributor

EthanZ23 commented Apr 12, 2025

Hello @aviendha-andrus,

Since I'm currently working on two calendar-related tasks myself, I was eager to familiarize myself early with your work. Also, I am more than glad to read through this PR. After reviewing the thoughtful discussions you've had with Chris and Dorian, and closely examining your calendar model, I wanted to highlight and express my appreciation!


Initial Impression:
I genuinely appreciate how organized and thorough your implementation is, especially how clearly you've structured the Calendar events model. The integration with assignments is particularly beneficial and practical for our calendar app functionality.


Great job, and I'll definitely reach out if I need any advice or further clarification while developing my own calendar features. Keep up the awesome work!

— Ethan

@aviendha-andrus
Copy link
Contributor Author

Hello @aviendha-andrus,

Since I'm currently working on two calendar-related tasks myself, I was eager to familiarize myself early with your work. Also, I am more than glad to read through this PR. After reviewing the thoughtful discussions you've had with Chris and Dorian, and closely examining your calendar model, I wanted to highlight and express my appreciation!

Initial Impression: I genuinely appreciate how organized and thorough your implementation is, especially how clearly you've structured the Calendar events model. The integration with assignments is particularly beneficial and practical for our calendar app functionality.

Great job, and I'll definitely reach out if I need any advice or further clarification while developing my own calendar features. Keep up the awesome work!

— Ethan

I’m so glad to hear your feedback in this! Because we are working on the same topic its important to keep each other updated so I’m grateful you saw my work and like what you see. I’ll keep an eye out for your work too and make sure I stay updated with it.

@aviendha-andrus aviendha-andrus merged commit 3ba9b2b into main Apr 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task: Calendar Events Model

7 participants