from Subscriptions.models import RegistrationForm, Student
from School.models import PaymentModeType
from django import template
register = template.Library()

@register.filter
def getRegistrationPaymentMethod(pk):
    registerForm = RegistrationForm.objects.get(student=pk)
    return PaymentModeType(registerForm.registration_payment).label

@register.filter
def getTuitionPaymentMethod(pk):
    registerForm = RegistrationForm.objects.get(student=pk)
    return PaymentModeType(registerForm.tuition_payment).label

@register.filter
def getStudentLevel(pk):
    registerForm = RegistrationForm.objects.get(student=pk)
    return Student.StudentLevel(int(registerForm.student.level)).label

@register.filter
def getStudentGender(pk):
    registerForm = RegistrationForm.objects.get(student=pk)
    return Student.StudentGender(int(registerForm.student.gender)).label