Menu

Objects

SHMolyneaux

Object inherits from [PStorBaseObject], and is the parent class of [Methods].

This class contains the following methods:

  • __init__
  • __setattr__
  • __delattr__
  • getcontents
  • getattributes
  • getncontents
  • getnrcontents
  • hasattr
  • __getattribute__
  • __str__
  • __repr__
  • keys
  • get__key__
  • update_handler
  • Method

Members

The Object class appends the above list of methods names to __reserved__ from [PStorBaseObject] with the exception of keys, get__key__, and update_handler.

Methods

__init__( connection, key )

  • creates a reference object that refers to a mutable object in the persistent storage system.

__setattr__( name, value )

  • sets the attribute name to value.

__delattr__( attr )

  • deletes the attribute attr.

getattributes()

  • returns a list of the names of a Object's attributes.

getcontents()

  • returns a list containing the __key__ of each attribute.

getncontents()

  • get a count of the contents

getnrcontents()

  • get a recursive count of the contents

hasattr( attr )

  • returns true if the Object has an attribute attr

__getattribute__( attr, python_object=1 )

  • attempts to return the value of attr. It first looks for the attribute in the database, then it looks for the attribute in the Object's Class (which is still on the database). If the attribute is not in either of those it looks for the attribute in the python object itself.

__str__()

  • returns a string "Object(%s)" where %s is repr(self.__key__)

__repr__()

  • functional the same as __str__.

keys()

  • not fully implemented.

getkey()

  • returns __key__.

update_handler( name )

  • a method meant to be overwritten. Called when the value of attribute is modified. name is the attribute that was modified.

Method( key=None )

  • convenience method to instantiate and return a new Method type object with a given key.

Related

Wiki: Classes
Wiki: Conventions
Wiki: Dicts, Lists, and Objects Basics
Wiki: Getting Started Explanation
Wiki: Links
Wiki: Methods
Wiki: PStorBaseObject
Wiki: Table of Contents
Wiki: Usable Python Types

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.