PaferaPy Async 0.1
ASGI framework focused on simplicity and efficiency
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
learn.schoolclass.learn_schoolclass Class Reference

Container class for students, courses, and teachers. More...

Inheritance diagram for learn.schoolclass.learn_schoolclass:
pafera.modelbase.ModelBase

Public Member Functions

def __init__ (self)
 Initialize all fields at creation like a good programmer should. More...
 
def GenerateAutoHomework (self, g)
 If autohomework is enabled, this function will generate a random challenge every day for your students to complete. More...
 
def UpdateChallenges (self, g)
 Look for any challenges that have passed endtime and calculate statistics for them. More...
 
def UpdateGrades (self, g, studentid)
 Recalculate grades for studentid and update class rankings. More...
 
- Public Member Functions inherited from pafera.modelbase.ModelBase
def __cmp__ (self, o)
 Comparing means simply subracting the database ids. More...
 
def __eq__ (self, o)
 Two objects are equivalent if their models are the same and their IDs are the same. More...
 
def __hash__ (self)
 We take the easy route where the hash for an object is just its database ID. More...
 
def __init__ (self)
 Initialize all fields at creation like a good programmer should. More...
 
def __repr__ (self)
 Simply outputs the toJSON() function with the model name. More...
 
def __str__ (self)
 Simply calls the toJSON() function. More...
 
def CheckPassword (self, field, password)
 This special function checks to see if the password matches the hash stored in the field. More...
 
def GetACL (self, db)
 Since we store ACLs as a database lookup, be sure to use these getters and setters if you plan on using ACLs. More...
 
def HasSameValues (self, o)
 While operator = only checks class and ids, this checks every field to see if two objects or an object and a dict have the same values. More...
 
def OffsetTime (self, timeoffset)
 Change all datetime fields to the new time offset. More...
 
def Set (self, **kwargs)
 We use this method instead of direct attribute access in order to keep track of what values have been changed. More...
 
def SetAccess (self, access)
 Special security functions that are useful only if you have enabled security in _dbflags for the model. More...
 
def SetACL (self, db, acl)
 ACLs in Pafera are defined as a set of rules similar to cascading style sheets. More...
 
def SetGroup (self, groupid)
 Special security functions that are useful only if you have enabled security in _dbflags for the model. More...
 
def SetOwner (self, ownerid)
 Special security functions that are useful only if you have enabled security in _dbflags for the model. More...
 
def SetPassword (self, field, password)
 This special function hashes the password before saving the field. More...
 
def ToJSON (self, fields='')
 Converts this object into a format suitable for inclusion in JSON. More...
 
def UpdateFields (self, fieldnames)
 This is a convenience method to update fields without going through the Set() method. More...
 

Public Attributes

 rankings
 
- Public Attributes inherited from pafera.modelbase.ModelBase
 d
 
 dbaccess
 
 dbacl
 
 dbaclid
 
 dbgroup
 
 dbowner
 
 id
 

Additional Inherited Members

- Static Public Attributes inherited from pafera.modelbase.ModelBase
list SECURE_FIELDS
 

Detailed Description

Container class for students, courses, and teachers.

This permits easy searching for students to apply and teachers to manage courses and students.

Definition at line 26 of file schoolclass.py.

Constructor & Destructor Documentation

◆ __init__()

def learn.schoolclass.learn_schoolclass.__init__ (   self)

Initialize all fields at creation like a good programmer should.

Reimplemented from pafera.modelbase.ModelBase.

Definition at line 58 of file schoolclass.py.

Member Function Documentation

◆ GenerateAutoHomework()

def learn.schoolclass.learn_schoolclass.GenerateAutoHomework (   self,
  g 
)

If autohomework is enabled, this function will generate a random challenge every day for your students to complete.

If review studylist is enabled, this will generate a challenge every day using each student's studylist.

Definition at line 190 of file schoolclass.py.

◆ UpdateChallenges()

def learn.schoolclass.learn_schoolclass.UpdateChallenges (   self,
  g 
)

Look for any challenges that have passed endtime and calculate statistics for them.

Definition at line 62 of file schoolclass.py.

◆ UpdateGrades()

def learn.schoolclass.learn_schoolclass.UpdateGrades (   self,
  g,
  studentid 
)

Recalculate grades for studentid and update class rankings.

Definition at line 84 of file schoolclass.py.

Member Data Documentation

◆ rankings

learn.schoolclass.learn_schoolclass.rankings

Definition at line 169 of file schoolclass.py.


The documentation for this class was generated from the following file: