PStorBaseObject - shmolyneaux/SquareJam GitHub Wiki
PStorBaseObject is an abstract class within pstorage which Lists, Dicts, and Objects are derived from.
The class contains the following members:
__reserved____key____connection____root____container__
It also contains the following methods:
canonicalnameDictListuri2pyislink__eq__
Members
__reserved__ is a list of strings containing the names of the members and methods in the previous two lists. This is used to insure that the values are not overwritten.
__key__ is a string containing the location of the object. For example the index attribute of _0_0_0_0 is Server/WebSites/_0_0_0_0/index.
__connection__ is a StorservConnection object. Important members of this class are __username__ and __sessIP__ to get the user's name, and the user's IP, respectively.
__root__ should be the Storage object at the root of the database this is currently an issue.
__container__ is the object that the current object is contained within.
Methods
canonicalname( key=None )
- returns
__key__if key equates to None, else it returnskey. This is used mainly for throwing exceptions within pstorage.
Dict( key=None )
- convenience method to instantiate and return a new
Dicttype object with a given key.
List( key=None )
- convenience method to instantiate and return a new
Listtype object with a given key.
uri2py( path )
- returns an attribute from a URI (similar to a URL). Example:
self.uri2py('_0_0_0_0/index/html')would return thehtmlMethodifselfis theWebSitesObject.
islink()
- returns true if the object is a link to another object.
eq( other )
- objects equate when they have the same
__key__.