Share and Money Management  0.16
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
smm.objects.Watch Class Reference

Class to handle watch list entries. More...

Inheritance diagram for smm.objects.Watch:

Public Member Functions

def __init__
 Create a new Watch instance.
def __str__
 Returns the content of this instance as string.
def remove
 Delete watch list entry.
- Public Member Functions inherited from smm.objects.SMMBaseObject
def __init__
 Initialise the instance and set attributes optionally.
def __repr__
 Returns the representation of this object as string.
def update
 Update instance arguments.
def add2db
 Add an object to the database.

Static Public Member Functions

def get
 Query Watch objects.

Static Public Attributes

dictionary arguments
string psTopic = 'smm.watch'
tuple id = Int(default=AutoReload, primary=True)
 Unique ID for each object.
tuple notes = Unicode()
 Detailed notes.
tuple share = Reference(id, Share.watch_id, on_remote=True)
 Reference to the Share object
tuple created = Date()
 Date when the watch object is created.
tuple expire = Date()
 Date when the watch object will be removed automatically.
- Static Public Attributes inherited from smm.objects.SMMBaseObject
dictionary arguments
 Set of argument names for keyword arguments.
tuple encoding = sys.stdout.encodingorsys.getdefaultencoding()
 Encoding of all character strings.
 psTopic = None
 Publish Subscribe Topic for this class.

Static Private Attributes

string __storm_table__ = "t_watch"
 Use given table to store all of this class inside.

Detailed Description

Class to handle watch list entries.

Test:
tests.test_objects.TestObjects.test_Watch_objects()

Constructor & Destructor Documentation

def smm.objects.Watch.__init__ (   self,
  share,
  created = datetime.date.today(),
  expire = None,
  notes = None 
)

Create a new Watch instance.

Parameters
selfThe object instance itself
shareShare to watch (smm.objects.Share object)
createdCreation date (datetime.date object, default: today)
expireExpiration date (datetime.date object, default: no expiration)
notesComment to the entry (default: None)
Emitted Notification:
smm.watch.change

References smm.objects.DailyQuote.share, and smm.objects.Watch.share.

Member Function Documentation

def smm.objects.Watch.__str__ (   self)

Returns the content of this instance as string.

References smm.objects.SMMBaseObject._encode(), smm.objects.Watch.created, smm.objects.Watch.expire, smm.objects.Exchange.id, smm.objects.Currency.id, smm.objects.Share.id, smm.objects.DailyQuote.id, smm.objects.Transaction.id, smm.objects.Watch.id, smm.objects.DailyQuote.share, and smm.objects.Watch.share.

Referenced by smm.objects.SMMBaseObject.__repr__().

Here is the call graph for this function:

Here is the caller graph for this function:

def smm.objects.Watch.get (   id = None,
  expired = False,
  share = None 
)
static

Query Watch objects.

There are three ways for querying objects:

  • Querying by id returns a Watch object or None
  • Query special entries described using share and/or expired
  • Querying without parameters to get all Watch objects

The last two ways returns always a storm.store.ResultSet.

Parameters
idReturns a watch list entry specified by id.
expiredBoolean flag to returns all expired watch list entries.
shareReturns a watch list entry specified by share.
Sorting:
The result are unsorted
Test:
tests.test_objects.TestObjects.test_Watch_get()
def smm.objects.Watch.remove (   self)

Delete watch list entry.

The reference between share and watch list entry will be cleaned and Watch object will be removed from the database.

References smm.objects.SMMBaseObject._remove().

Here is the call graph for this function:

Member Data Documentation

string smm.objects.Watch.__storm_table__ = "t_watch"
staticprivate

Use given table to store all of this class inside.

dictionary smm.objects.Watch.arguments
static
Initial value:
{
'created': None,
'expire': None,
'notes': 'unicode',
'share': None,
}
tuple smm.objects.Watch.created = Date()
static

Date when the watch object is created.

Referenced by smm.objects.Watch.__str__().

tuple smm.objects.Watch.expire = Date()
static

Date when the watch object will be removed automatically.

Referenced by smm.objects.Watch.__str__().

tuple smm.objects.Watch.id = Int(default=AutoReload, primary=True)
static
tuple smm.objects.Watch.notes = Unicode()
static

Detailed notes.

string smm.objects.Watch.psTopic = 'smm.watch'
static
tuple smm.objects.Watch.share = Reference(id, Share.watch_id, on_remote=True)
static

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