-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Break CRUD routes #703
base: master
Are you sure you want to change the base?
Break CRUD routes #703
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! Just left a few comments to look at.
backend/courses/models.py
Outdated
|
||
associated_break = models.ForeignKey( | ||
"plan.Break", | ||
null=True, | ||
on_delete=models.CASCADE, | ||
related_name="meetings", | ||
help_text="The Section object to which this class meeting belongs.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Meeting object"
backend/courses/models.py
Outdated
@@ -1180,6 +1190,19 @@ class Meeting(models.Model): | |||
), | |||
) | |||
|
|||
def clean(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using Django's built in CONSTRAINT libraries. It is probably more natural to SQL
https://docs.djangoproject.com/en/5.1/ref/models/constraints/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thing, but looking good!
backend/plan/views.py
Outdated
context = super().get_serializer_context() | ||
include_location_str = "False" | ||
# TODO: figure out how we want to do locations. | ||
context.update({"include_location": eval(include_location_str)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets try not to use eval, if locations are not considered in this v1 version, we can comment out?
I think work now? |
This pr adds a break view set so that someone can create and update breaks on PCP in the backend.
This is a simple view set with CRUD routes that should let a user add breaks to their schedule in penn course plan.
I wrote test cases in test_schedule.py.
Some design decisions: