Created
January 14, 2014 07:10
-
-
Save mtomwing/8414352 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import os | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'courses.settings') | |
from gpaconvert.models import GradeSource, DiscreteRule, ContinuousRule | |
GradeSource.objects.all().delete() | |
DISCRETE_GRADES = ( | |
('Super Sully', 'A'), | |
('Mediocre Mike', 'C'), | |
) | |
CONTINUOUS_GRADES = ( | |
(100.0, 'A+'), | |
(50.0, 'C'), | |
(0.0, 'F'), | |
) | |
monsters_uni = GradeSource.objects.create(country='CA', | |
institution='Monsters University', | |
status='ACTI') | |
for source, target in DISCRETE_GRADES: | |
monsters_uni.discrete_rules.add(DiscreteRule(lookup_value=source, | |
transfer_value=target)) | |
monsters_uni.save() | |
balls_uni = GradeSource.objects.create(country='US', | |
institution='Ball State University', | |
status='ACTI') | |
for source, target in CONTINUOUS_GRADES: | |
balls_uni.continuous_rules.add(ContinuousRule(lookup_lbound=source, | |
transfer_value=target)) | |
balls_uni.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment