PaferaPy Async 0.1
ASGI framework focused on simplicity and efficiency
Loading...
Searching...
No Matches
student.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
9STUDENT_ACCEPTED = 0x0
10STUDENT_APPLIED = 0x1
11
12# *********************************************************************
14 """This class keeps track of student information, purchased items,
15 and allowed cards.
16 """
17
18 _dbfields = {
19 'userid': ('INTEGER', 'PRIMARY KEY NOT NULL',),
20 'displayname': ('TRANSLATION', 'NOT NULL', BlankValidator()),
21 'profile': ('TEXT', "NOT NULL DEFAULT ''",),
22 'phonenumber': ('TEXT', 'NOT NULL', BlankValidator()),
23 'grade': ('TEXT', "NOT NULL DEFAULT ''", ),
24 'coins': ('INT', 'NOT NULL DEFAULT 0',),
25 'items': ('DICT', "NOT NULL DEFAULT ''",),
26 'allowedcards': ('NEWLINELIST', "NOT NULL DEFAULT ''",),
27 'flags': ('INT', 'NOT NULL DEFAULT 0',),
28 }
29 _dbindexes = ()
30 _dblinks = [
31 'learn_schoolclass',
32 'learn_school',
33 'learn_card'
34 ]
35 _dbdisplay = ['displayname']
36 _dbflags = 0
37
38 # -------------------------------------------------------------------
39 def __init__(self):
40 super().__init__()
This class keeps track of student information, purchased items, and allowed cards.
Definition: student.py:13
def __init__(self)
Initialize all fields at creation like a good programmer should.
Definition: student.py:39
Base class for all database models.
Definition: modelbase.py:20
Throws an exception on blank values.
Definition: validators.py:43
Definition: db.py:1