Commit 8a7ec6c9ffc29ab08eb597b11098bd1d2b748e92
1 parent
6bbc064d
Exists in
dev
rename f_quota to quota_f
Showing
3 changed files
with
19 additions
and
19 deletions
Show diff stats
src/core/pyros_django/scp_mgmt/A_SCP_Manager.py
... | ... | @@ -248,10 +248,10 @@ class A_SCP_Manager(Agent): |
248 | 248 | |
249 | 249 | def set_quota_for_institutes(self, id_period): |
250 | 250 | for institute in Institute.objects.all(): |
251 | - f_quota = institute.f_quota | |
251 | + quota_f = institute.quota_f | |
252 | 252 | # the lowest id of quota table for this period should be the first night of the period |
253 | 253 | period_quota = Period.objects.get(id=id_period).quota |
254 | - institute_quota = period_quota.convert_to_quota(f_quota) | |
254 | + institute_quota = period_quota.convert_to_quota(quota_f) | |
255 | 255 | new_quota = Quota() |
256 | 256 | new_quota.set_attributes_and_save(institute_quota) |
257 | 257 | institute.quota = new_quota |
... | ... | @@ -264,7 +264,7 @@ class A_SCP_Manager(Agent): |
264 | 264 | institute = sp.institute |
265 | 265 | institute_quota = institute.quota |
266 | 266 | new_quota = Quota() |
267 | - quota_attributes = institute_quota.convert_to_quota(sp.f_quota) | |
267 | + quota_attributes = institute_quota.convert_to_quota(sp.quota_f) | |
268 | 268 | new_quota.set_attributes_and_save(quota_attributes) |
269 | 269 | |
270 | 270 | ... | ... |
src/core/pyros_django/scp_mgmt/models.py
... | ... | @@ -74,20 +74,20 @@ class Quota(models.Model): |
74 | 74 | self.d_nextx = quota_attributes["d_nextx"] |
75 | 75 | self.save() |
76 | 76 | |
77 | - def convert_to_quota(self, f_quota): | |
77 | + def convert_to_quota(self, quota_f): | |
78 | 78 | quota_institute = {} |
79 | 79 | |
80 | - quota_institute["d_totalq"] = self.d_totalq * f_quota | |
81 | - quota_institute["d_totalx"] = self.d_totalx * f_quota | |
82 | - quota_institute["d_previousq"] = self.d_previousq * f_quota | |
83 | - quota_institute["d_previousx"] = self.d_previousx * f_quota | |
84 | - quota_institute["d_currentq"] = self.d_currentq * f_quota | |
85 | - quota_institute["d_currentx"] = self.d_currentx * f_quota | |
86 | - quota_institute["d_passedq"] = self.d_passedq * f_quota | |
87 | - quota_institute["d_passedx"] = self.d_passedx * f_quota | |
88 | - quota_institute["d_scheduleq"] = self.d_scheduleq * f_quota | |
89 | - quota_institute["d_schedulex"] = self.d_schedulex * f_quota | |
90 | - quota_institute["d_nextq"] = self.d_nextq * f_quota | |
91 | - quota_institute["d_nextx"] = self.d_nextx * f_quota | |
80 | + quota_institute["d_totalq"] = self.d_totalq * quota_f | |
81 | + quota_institute["d_totalx"] = self.d_totalx * quota_f | |
82 | + quota_institute["d_previousq"] = self.d_previousq * quota_f | |
83 | + quota_institute["d_previousx"] = self.d_previousx * quota_f | |
84 | + quota_institute["d_currentq"] = self.d_currentq * quota_f | |
85 | + quota_institute["d_currentx"] = self.d_currentx * quota_f | |
86 | + quota_institute["d_passedq"] = self.d_passedq * quota_f | |
87 | + quota_institute["d_passedx"] = self.d_passedx * quota_f | |
88 | + quota_institute["d_scheduleq"] = self.d_scheduleq * quota_f | |
89 | + quota_institute["d_schedulex"] = self.d_schedulex * quota_f | |
90 | + quota_institute["d_nextq"] = self.d_nextq * quota_f | |
91 | + quota_institute["d_nextx"] = self.d_nextx * quota_f | |
92 | 92 | |
93 | 93 | return quota_institute | ... | ... |
src/core/pyros_django/user_mgmt/models.py
... | ... | @@ -84,7 +84,7 @@ class Institute(models.Model): |
84 | 84 | name = models.CharField(max_length=100, blank=False, |
85 | 85 | null=False, unique=True) |
86 | 86 | # fraction quota |
87 | - f_quota = models.FloatField( | |
87 | + quota_f = models.FloatField( | |
88 | 88 | validators=[MinValueValidator(0), MaxValueValidator(1)], blank=True, null=True) |
89 | 89 | |
90 | 90 | quota = models.ForeignKey(Quota, on_delete=models.DO_NOTHING,related_name="institute_quotas", blank=True, null=True) |
... | ... | @@ -476,9 +476,9 @@ class ScientificProgram(models.Model): |
476 | 476 | is_auto_validated = models.BooleanField(default=False) |
477 | 477 | objects = ScientificProgramManager() |
478 | 478 | quota = models.ForeignKey(Quota, on_delete=models.DO_NOTHING,related_name="scientific_program_quotas", blank=True, null=True) |
479 | - f_quota = models.FloatField( | |
479 | + quota_f = models.FloatField( | |
480 | 480 | validators=[MinValueValidator(0), MaxValueValidator(1)], blank=True, null=True) |
481 | - | |
481 | + | |
482 | 482 | class Meta: |
483 | 483 | managed = True |
484 | 484 | db_table = 'scientific_program' | ... | ... |