forked from pennlabs/penn-courses
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
79 additions
and
903 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,136 +1,101 @@ | ||
# Generated by Django 3.2.20 on 2023-10-27 04:21 | ||
# Generated by Django 3.2.23 on 2024-02-08 06:11 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [] | ||
dependencies = [ | ||
('courses', '0061_merge_20231112_1524'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="DegreePlan", | ||
name='Degree', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('program', models.CharField(choices=[('EU_BSE', 'Engineering BSE'), ('EU_BAS', 'Engineering BAS'), ('AU_BA', 'College BA'), ('WU_BS', 'Wharton BS')], help_text='\nThe program code for this degree, e.g., EU_BSE\n', max_length=10)), | ||
('degree', models.CharField(help_text='\nThe degree code for this degree, e.g., BSE\n', max_length=4)), | ||
('major', models.CharField(help_text='\nThe major code for this degree, e.g., BIOL\n', max_length=4)), | ||
('concentration', models.CharField(help_text='\nThe concentration code for this degree, e.g., BMAT\n', max_length=4, null=True)), | ||
('year', models.IntegerField(help_text='\nThe effective year of this degree, e.g., 2023\n')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='DegreePlan', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(help_text="The user's nickname for the degree plan.", max_length=255)), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('updated_at', models.DateTimeField(auto_now=True)), | ||
('degrees', models.ManyToManyField(help_text='The degrees this degree plan is associated with.', to='degree.Degree')), | ||
('person', models.ForeignKey(help_text='The user the degree plan belongs to.', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Rule', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(blank=True, help_text='\nThe title for this rule.\n', max_length=200)), | ||
('num', models.PositiveSmallIntegerField(help_text='\nThe minimum number of courses or subrules required for this rule.\n', null=True)), | ||
('credits', models.DecimalField(decimal_places=2, help_text='\nThe minimum number of CUs required for this rule. Only non-null\nif this is a Rule leaf.\n', max_digits=4, null=True)), | ||
('q', models.TextField(blank=True, help_text='\nString representing a Q() object that returns the set of courses\nsatisfying this rule. Non-empty iff this is a Rule leaf.\nThis Q object is expected to be normalized before it is serialized\nto a string.\n', max_length=1000)), | ||
('parent', models.ForeignKey(help_text="\nThis rule's parent Rule if it has one. Null if this is a top level rule\n(i.e., this rule belongs to some Degree's `.rules` set).\n", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='degree.rule')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='SatisfactionStatus', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('satisfied', models.BooleanField(default=False, help_text='Whether the rule is satisfied')), | ||
('last_updated', models.DateTimeField(auto_now=True)), | ||
('last_checked', models.DateTimeField(default=django.utils.timezone.now)), | ||
('degree_plan', models.ForeignKey(help_text='The degree plan that leads to the satisfaction of the rule', on_delete=django.db.models.deletion.CASCADE, related_name='satisfactions', to='degree.degreeplan')), | ||
('rule', models.ForeignKey(help_text='The rule that is satisfied', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='degree.rule')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Fulfillment', | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, primary_key=True, serialize=False, verbose_name="ID" | ||
), | ||
), | ||
( | ||
"program", | ||
models.CharField( | ||
choices=[ | ||
("EU_BSE", "Engineering BSE"), | ||
("EU_BAS", "Engineering BAS"), | ||
("AU_BA", "College BA"), | ||
("WU_BS", "Wharton BS"), | ||
], | ||
help_text="\nThe program code for this degree plan, e.g., EU_BSE\n", | ||
max_length=10, | ||
), | ||
), | ||
( | ||
"degree", | ||
models.CharField( | ||
help_text="\nThe degree code for this degree plan, e.g., BSE\n", | ||
max_length=4, | ||
), | ||
), | ||
( | ||
"major", | ||
models.CharField( | ||
help_text="\nThe major code for this degree plan, e.g., BIOL\n", | ||
max_length=4, | ||
), | ||
), | ||
( | ||
"concentration", | ||
models.CharField( | ||
help_text="\nThe concentration code for this degree plan, e.g., BMAT\n", | ||
max_length=4, | ||
null=True, | ||
), | ||
), | ||
( | ||
"year", | ||
models.IntegerField( | ||
help_text="\nThe effective year of this degree plan, e.g., 2023\n" | ||
), | ||
), | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('full_code', models.CharField(blank=True, db_index=True, help_text='The dash-joined department and code of the course, e.g., `CIS-120`', max_length=16)), | ||
('semester', models.CharField(help_text='\nThe semester of the course (of the form YYYYx where x is A [for spring],\nB [summer], or C [fall]), e.g. `2019C` for fall 2019. Null if this fulfillment\ndoes not yet have a semester.\n', max_length=5, null=True)), | ||
('degree_plan', models.ForeignKey(help_text='The degree plan with which this fulfillment is associated', on_delete=django.db.models.deletion.CASCADE, related_name='fulfillments', to='degree.degreeplan')), | ||
('historical_course', models.ForeignKey(help_text='\nThe last offering of the course with the full code, or null if\nthere is no such historical course.\n', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='courses.course')), | ||
('rules', models.ManyToManyField(blank=True, help_text='\nThe rules this course fulfills. Blank if this course does not apply\nto any rules.\n', related_name='_degree_fulfillment_rules_+', to='degree.Rule')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name="Rule", | ||
name='DoubleCountRestriction', | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, primary_key=True, serialize=False, verbose_name="ID" | ||
), | ||
), | ||
( | ||
"title", | ||
models.CharField( | ||
blank=True, help_text="\nThe title for this rule.\n", max_length=200 | ||
), | ||
), | ||
( | ||
"num_courses", | ||
models.PositiveSmallIntegerField( | ||
help_text="\nThe minimum number of courses or subrules required for this rule. Only non-null\nif this is a Rule leaf.\n", | ||
null=True, | ||
), | ||
), | ||
( | ||
"credits", | ||
models.DecimalField( | ||
decimal_places=2, | ||
help_text="\nThe minimum number of CUs required for this rule. Only non-null\nif this is a Rule leaf. Can be \n", | ||
max_digits=4, | ||
null=True, | ||
), | ||
), | ||
( | ||
"q", | ||
models.TextField( | ||
help_text="\nString representing a Q() object that returns the set of courses\nsatisfying this rule. Only non-null/non-empty if this is a Rule leaf.\nThis Q object is expected to be normalized before it is serialized\nto a string.\n", | ||
max_length=1000, | ||
), | ||
), | ||
( | ||
"degree_plan", | ||
models.ForeignKey( | ||
help_text="\nThe degree plan that has this rule.\n", | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="degree.degreeplan", | ||
), | ||
), | ||
( | ||
"parent", | ||
models.ForeignKey( | ||
help_text="\nThis rule's parent Rule if it has one.\n", | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="children", | ||
to="degree.rule", | ||
), | ||
), | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('max_courses', models.PositiveSmallIntegerField(help_text='\nThe maximum number of courses you can count for both rules.\nIf null, there is no limit, and max_credits must not be null.\n', null=True)), | ||
('max_credits', models.DecimalField(decimal_places=2, help_text='\nThe maximum number of CUs you can count for both rules.\nIf null, there is no limit, and max_credits must not be null.\n', max_digits=4, null=True)), | ||
('other_rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='degree.rule')), | ||
('rule', models.ForeignKey(help_text='\nA rule in the double count restriction.\n', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='degree.rule')), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name='degree', | ||
name='rules', | ||
field=models.ManyToManyField(blank=True, help_text='\nThe rules for this degree. Blank if this degree has no rules.\n', related_name='degrees', to='degree.Rule'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='satisfactionstatus', | ||
constraint=models.UniqueConstraint(fields=('degree_plan', 'rule'), name='unique_satisfaction'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='degreeplan', | ||
constraint=models.UniqueConstraint(fields=('name', 'person'), name='degreeplan_name_person'), | ||
), | ||
migrations.AddConstraint( | ||
model_name="rule", | ||
constraint=models.CheckConstraint( | ||
check=models.Q( | ||
models.Q(("credits__isnull", True), ("credits__gt", 0), _connector="OR"), | ||
models.Q( | ||
("num_courses__isnull", True), ("num_courses__gt", 0), _connector="OR" | ||
), | ||
), | ||
name="num_course_credits_gt_0", | ||
), | ||
model_name='degree', | ||
constraint=models.UniqueConstraint(fields=('program', 'degree', 'major', 'concentration', 'year'), name='unique degree'), | ||
), | ||
] |
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
backend/degree/migrations/0003_degreeplan_unique degreeplan.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.