Example #1
0
 def create(cls, employee_id: non_negative(non_null(int))) -> model:
     feedback = (Feedback.objects.select_related(
         'user', 'personal_satisfaction', 'team_satisfaction',
         'company_satisfaction').order_by('-id').filter(
             user_id=employee_id).first())
     # TODO: add report generation logic
     return
def foo(
    a: non_blank(),
    b: non_null(),
    c: non_empty(),
    d: no_whitespaces(),
    e: non_negative(),
    f: strongly_typed(List),
):
    return a, b, c, d, e, f
Example #3
0
 def create(
     cls, name: non_null(non_blank(str)), surname: non_null(non_blank(str)),
     position: non_null(non_blank(str)), level: non_null(non_blank(str)),
     email: non_null(non_blank(str)), pay: non_negative(non_null(int))
 ) -> User:
     validate_email(email)
     return cls.model.objects.create(name=name,
                                     surname=surname,
                                     position=position,
                                     hire_date=date.today(),
                                     level=level,
                                     email=email,
                                     pay=pay)