-
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
Onboarding backend #624
Open
ashleymyan
wants to merge
12
commits into
master
Choose a base branch
from
onboarding-backend
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+39,564
−3,369
Open
Onboarding backend #624
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a71572a
initial degreeprofile model
ashleymyan 06018b2
Merge branch 'master' of https://github.com/pennlabs/penn-degree-plan
ashleymyan 3fd6dc0
WIP: models, serializers, url, viewsets
ashleymyan 3dcb85e
WIP: test cases for models and api
ashleymyan 2fed696
implemented degreeprofile, coursetaken
ashleymyan d59c01e
linted
ashleymyan 39b5e41
initial degreeprofile model
ashleymyan 86c0965
WIP: models, serializers, url, viewsets
ashleymyan 2f2fdfc
WIP: test cases for models and api
ashleymyan 6a55ac6
implemented degreeprofile, coursetaken
ashleymyan faf3804
linted
ashleymyan 8b98053
Merge branch 'onboarding-backend' of github.com:pennlabs/penn-degree-…
AaDalal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1322,7 +1322,7 @@ def satisfying_courses(self): | |
| Q(id__in=self.courses.all()) | ||
) | ||
) | ||
|
||
|
||
""" | ||
3rd-Party API | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Generated by Django 3.2.24 on 2024-03-24 16:46 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('courses', '0066_course_credits'), | ||
('degree', '0007_alter_dockedcourse_full_code'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='CourseTaken', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('semester', models.CharField(help_text='\nThe semester taken, in the form YYYYx\n', max_length=5)), | ||
('grade', models.CharField(help_text="\nThe user's grade for this course\n", max_length=2)), | ||
('course', models.ForeignKey(help_text='\nA list of course codes that the user has already taken, matched with semester\n', on_delete=django.db.models.deletion.CASCADE, to='courses.course')), | ||
], | ||
), | ||
migrations.AlterField( | ||
model_name='degree', | ||
name='program', | ||
field=models.CharField(choices=[('EU_BSE', 'Engineering BSE'), ('EU_BAS', 'Engineering BAS'), ('AU_BA', 'College BA'), ('WU_BS', 'Wharton BS'), ('NU_BSN', 'Nursing BSN')], help_text='\nThe program code for this degree, e.g., EU_BSE\n', max_length=10), | ||
), | ||
migrations.CreateModel( | ||
name='Transcript', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('program', models.CharField(db_index=True, help_text="\nThe user's current program (e.g. SEAS B.S.)\n", max_length=255)), | ||
('courses', models.ForeignKey(blank=True, help_text='\nCourses already taken, prob a list of Course objects\n', null=True, on_delete=django.db.models.deletion.SET_NULL, to='courses.course')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='DegreeProfile', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('graduation_date', models.CharField(help_text="\nThe user's expected graduation date (of the form YYYYx where x is A [for spring],\nB [summer], or C [fall]), e.g. `2019C` for fall 2019)\n", max_length=5)), | ||
('courses_taken', models.ManyToManyField(help_text='\nA list of course codes that the user has already taken, matched with semester\n', related_name='degree_profiles', through='degree.CourseTaken', to='courses.Course')), | ||
('degrees', models.ManyToManyField(help_text="\nThe user's current degree(s)\n", to='degree.Degree')), | ||
('transcript', models.OneToOneField(help_text="The user's uploaded transcript parsed into a Transcript object (optional)", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='degree_profile', to='degree.transcript')), | ||
('transfer_credits', models.ManyToManyField(help_text='\nTransfer credits\n', related_name='transfer_credit_profiles', to='courses.Course')), | ||
('user_profile', models.OneToOneField(help_text='extending the user profile class from courses to store degree plan specific info', on_delete=django.db.models.deletion.CASCADE, related_name='degree_profile', to='courses.userprofile')), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name='coursetaken', | ||
name='degree_profile', | ||
field=models.ForeignKey(help_text='\nThe degree profile belonging to the user that took this course\n', on_delete=django.db.models.deletion.CASCADE, to='degree.degreeprofile'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='coursetaken', | ||
constraint=models.UniqueConstraint(fields=('degree_profile', 'course', 'semester'), name='unique_course_taken'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Generated by Django 3.2.24 on 2024-03-24 21:30 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('courses', '0066_course_credits'), | ||
('degree', '0008_auto_20240324_1246'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveConstraint( | ||
model_name='coursetaken', | ||
name='unique_course_taken', | ||
), | ||
migrations.AlterField( | ||
model_name='coursetaken', | ||
name='degree_profile', | ||
field=models.ForeignKey(help_text='\nThe degree profile to which this course was taken\n', on_delete=django.db.models.deletion.CASCADE, to='degree.degreeprofile'), | ||
), | ||
migrations.AlterField( | ||
model_name='degreeprofile', | ||
name='courses_taken', | ||
field=models.ManyToManyField(help_text='\nA list of course codes that the user has already taken, matched with semester\n', related_name='degree_profile', through='degree.CourseTaken', to='courses.Course'), | ||
), | ||
migrations.AlterField( | ||
model_name='degreeprofile', | ||
name='transfer_credits', | ||
field=models.ManyToManyField(help_text='\nTransfer credits\n', related_name='transfer_credits_for', to='courses.Course'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='coursetaken', | ||
constraint=models.UniqueConstraint(fields=('degree_profile', 'course', 'semester'), name='unique-degree-profile'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 3.2.24 on 2024-03-24 21:32 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('degree', '0009_auto_20240324_1730'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveConstraint( | ||
model_name='coursetaken', | ||
name='unique-degree-profile', | ||
), | ||
migrations.AddConstraint( | ||
model_name='coursetaken', | ||
constraint=models.UniqueConstraint(fields=('degree_profile', 'course', 'semester'), name='unique-course-taken'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='degreeprofile', | ||
constraint=models.UniqueConstraint(fields=('user_profile',), name='unique-degree-profile'), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
backend/degree/migrations/0011_alter_coursetaken_course.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 3.2.24 on 2024-03-24 23:06 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('courses', '0066_course_credits'), | ||
('degree', '0010_auto_20240324_1732'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='coursetaken', | ||
name='course', | ||
field=models.ForeignKey(help_text='\nThe course code (e.g. CIS-1210) of the course taken\n', on_delete=django.db.models.deletion.CASCADE, to='courses.course'), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
backend/degree/migrations/0012_alter_coursetaken_course.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 3.2.24 on 2024-03-28 05:54 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('courses', '0066_course_credits'), | ||
('degree', '0011_alter_coursetaken_course'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='coursetaken', | ||
name='course', | ||
field=models.ForeignKey(help_text='\nThe full-code (e.g. CIS-1210) of the course taken\n', on_delete=django.db.models.deletion.CASCADE, to='courses.course'), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
backend/degree/migrations/0013_alter_coursetaken_course.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 3.2.24 on 2024-03-28 06:33 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('courses', '0066_course_credits'), | ||
('degree', '0012_alter_coursetaken_course'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='coursetaken', | ||
name='course', | ||
field=models.ForeignKey(help_text='\nThe course ID of the course taken\n', on_delete=django.db.models.deletion.CASCADE, to='courses.course'), | ||
), | ||
] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nit: it's a good idea to merge these migrations into one (you can just roll back to the migration before the ones you added using
python manage.py migrate XXXX
where XXXX is the last migration not in this PR. You can then delete all the migrations created in this PR and runpython manage.py makemigration