Grade

Qualified name: intranet.apps.users.models.Grade

class intranet.apps.users.models.Grade(graduation_year)[source]

Bases: object

Represents a user’s grade.

Methods

grade_from_year

number_from_name

year_from_grade

Attributes

name

Return the grade's name (e.g.

name_plural

Return the grade's plural name (e.g.

names

number

Return the grade as a number (9-12).

text

Return the grade's number as a string (e.g.

__init__(graduation_year)[source]

Initialize the Grade object.

Parameters:

graduation_year – The numerical graduation year of the user

__int__()[source]

Return the grade as a number (9-12).

__str__()[source]

Return name of the grade.

property name: str

Return the grade’s name (e.g. senior)

property name_plural: str

Return the grade’s plural name (e.g. freshmen)

property number: int

Return the grade as a number (9-12).

For use in templates since there is no nice integer casting. In Python code you can also use int() on a Grade object.

property text: str

Return the grade’s number as a string (e.g. Grade 12, Graduate)