Coverage for app/models/individualRequirement.py: 100%

18 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2024-11-22 21:05 +0000

1from datetime import datetime 

2 

3from app.models import* 

4from app.models.user import User 

5from app.models.term import Term 

6from app.models.course import Course 

7from app.models.program import Program 

8from app.models.certificationRequirement import CertificationRequirement 

9 

10 

11class IndividualRequirement(baseModel): 

12 program = ForeignKeyField(Program, null = True) 

13 course = ForeignKeyField(Course, null = True) 

14 description = CharField(null = True) 

15 username = ForeignKeyField(User) 

16 term = ForeignKeyField(Term, null = True) 

17 requirement = ForeignKeyField(CertificationRequirement) 

18 addedBy = ForeignKeyField(User) 

19 addedOn = DateTimeField(default=datetime.now) 

20 

21 class Meta: 

22 constraints = [SQL('UNIQUE (username_id, requirement_id)')]