PaferaPy Async 0.1
ASGI framework focused on simplicity and efficiency
Loading...
Searching...
No Matches
teacher.py
Go to the documentation of this file.
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3
4import pafera.db
6
7from pafera.validators import *
8
9TEACHER_ACCEPTED = 0x0
10TEACHER_APPLIED = 0x1
11
12# *********************************************************************
14 """Contains teacher contact information and allowed cards.
15 """
16
17 _dbfields = {
18 'userid': ('INTEGER', 'PRIMARY KEY NOT NULL',),
19 'displayname': ('TRANSLATION', 'NOT NULL', BlankValidator()),
20 'profile': ('TRANSLATION', 'NOT NULL', BlankValidator()),
21 'phonenumber': ('TRANSLATION', 'NOT NULL', BlankValidator()),
22 'email': ('TRANSLATION', 'NOT NULL', BlankValidator()),
23 'contactinfo': ('TRANSLATION', "NOT NULL DEFAULT ''",),
24 'allowedcards': ('NEWLINELIST', "NOT NULL DEFAULT ''",),
25 'numclasses': ('INT', 'NOT NULL DEFAULT 0',),
26 'numstudents': ('INT', 'NOT NULL DEFAULT 0',),
27 'flags': ('INT', 'NOT NULL DEFAULT 0',),
28 }
29 _dbindexes = ()
30 _dblinks = [
31 'learn_schoolclass',
32 'learn_school',
33 'learn_student',
34 'learn_card'
35 ]
36 _dbdisplay = ['displayname', 'profile', 'phonenumber', 'email']
37 _dbflags = 0
38
39 # -------------------------------------------------------------------
40 def __init__(self):
41 super().__init__()
42
Contains teacher contact information and allowed cards.
Definition: teacher.py:13
def __init__(self)
Initialize all fields at creation like a good programmer should.
Definition: teacher.py:40
Base class for all database models.
Definition: modelbase.py:20
Throws an exception on blank values.
Definition: validators.py:43
Definition: db.py:1