PaferaPy Async 0.1
ASGI framework focused on simplicity and efficiency
|
Keeps track of user sessions, language selection, and application data. More...
Public Member Functions | |
def | __delitem__ (self, key) |
Convenience functions to allow the session object to be used as a dict that saves settings at the end of the script. More... | |
def | __getitem__ (self, key) |
Convenience functions to allow the session object to be used as a dict that saves settings at the end of the script. More... | |
def | __init__ (self) |
Initialize all fields at creation like a good programmer should. More... | |
def | __setitem__ (self, key, value) |
Convenience functions to allow the session object to be used as a dict that saves settings at the end of the script. More... | |
def | CheckExpired (self, g) |
See if the current session has expired and creates a new one if necessary. More... | |
def | get (self, key, defaultvalue=None) |
Convenience functions to allow the session object to be used as a dict that saves settings at the end of the script. More... | |
def | New (self, g) |
Creates a new session, closing the old session. More... | |
![]() | |
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 | |
data | |
needupdate | |
urls | |
![]() | |
d | |
dbaccess | |
dbacl | |
dbaclid | |
dbgroup | |
dbowner | |
id | |
Additional Inherited Members | |
![]() | |
list | SECURE_FIELDS |
Keeps track of user sessions, language selection, and application data.
This class also has the ability to record every URL that the user visited and how long they stayed on that page if g.siteconfig['urltracking'] is enabled. It makes the system a bit slower, but gives you much better analysis of what the user did and what they were interested in.
Definition at line 43 of file session.py.
def system.session.system_session.__init__ | ( | self | ) |
Initialize all fields at creation like a good programmer should.
Reimplemented from pafera.modelbase.ModelBase.
Definition at line 75 of file session.py.
def system.session.system_session.__delitem__ | ( | self, | |
key | |||
) |
Convenience functions to allow the session object to be used as a dict that saves settings at the end of the script.
Definition at line 199 of file session.py.
def system.session.system_session.__getitem__ | ( | self, | |
key | |||
) |
Convenience functions to allow the session object to be used as a dict that saves settings at the end of the script.
Definition at line 176 of file session.py.
def system.session.system_session.__setitem__ | ( | self, | |
key, | |||
value | |||
) |
Convenience functions to allow the session object to be used as a dict that saves settings at the end of the script.
Definition at line 187 of file session.py.
def system.session.system_session.CheckExpired | ( | self, | |
g | |||
) |
See if the current session has expired and creates a new one if necessary.
Definition at line 83 of file session.py.
def system.session.system_session.get | ( | self, | |
key, | |||
defaultvalue = None |
|||
) |
Convenience functions to allow the session object to be used as a dict that saves settings at the end of the script.
Definition at line 207 of file session.py.
def system.session.system_session.New | ( | self, | |
g | |||
) |
Creates a new session, closing the old session.
This also setups the useragent, languages, and other default settings.
Definition at line 101 of file session.py.
system.session.system_session.data |
Definition at line 78 of file session.py.
system.session.system_session.needupdate |
Definition at line 80 of file session.py.
system.session.system_session.urls |
Definition at line 79 of file session.py.