PaferaPy Async 0.1
ASGI framework focused on simplicity and efficiency
Loading...
Searching...
No Matches
school.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
9# Flag constants
10SCHOOL_AUTO_APPROVE = 0x01
11
12# *********************************************************************
14 """Represents a school, which organizes students, teachers, and classes.
15
16 This class is pretty much just an easy way to search for contact
17 information.
18 """
19
20 _dbfields = {
21 'rid': ('INTEGER', 'PRIMARY KEY NOT NULL',),
22 'icon': ('IMAGEFILE', "NOT NULL DEFAULT ''",),
23 'displayname': ('TRANSLATION', 'NOT NULL', BlankValidator()),
24 'description': ('TRANSLATION', 'NOT NULL', BlankValidator()),
25 'address': ('TRANSLATION', 'NOT NULL', BlankValidator()),
26 'phone': ('TRANSLATION', 'NOT NULL', BlankValidator()),
27 'email': ('TRANSLATION', 'NOT NULL', BlankValidator()),
28 'contactinfo': ('TRANSLATION', "NOT NULL DEFAULT ''",),
29 'numadministrators': ('INT', 'NOT NULL DEFAULT 0',),
30 'numteachers': ('INT', 'NOT NULL DEFAULT 0',),
31 'numclasses': ('INT', 'NOT NULL DEFAULT 0',),
32 'numstudents': ('INT', 'NOT NULL DEFAULT 0',),
33 'flags': ('INT', 'NOT NULL DEFAULT 0',),
34 }
35 _dbindexes = ()
36 _dblinks = [
37 'learn_schoolclass',
38 'learn_teacher',
39 'learn_student',
40 'learn_schooladministrator',
41 'learn_schoolsystemadministrator',
42 ]
43 _dbdisplay = ['displayname', 'description', 'address', 'phone', 'email']
44 _dbflags = 0
45
46 # -------------------------------------------------------------------
47 def __init__(self):
48 super().__init__()
49
Represents a school, which organizes students, teachers, and classes.
Definition: school.py:13
def __init__(self)
Initialize all fields at creation like a good programmer should.
Definition: school.py:47
Base class for all database models.
Definition: modelbase.py:20
Throws an exception on blank values.
Definition: validators.py:43
Definition: db.py:1