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__ (self, share, created=datetime.date.today(), expire=None, notes=None)
 Create a new Watch instance. More...
 
def __str__ (self)
 Returns the content of this instance as string. More...
 
def remove (self)
 Delete watch list entry. More...
 
- Public Member Functions inherited from smm.objects.SMMBaseObject
def __init__ (self, **kwargs)
 Initialise the instance and set attributes optionally. More...
 
def __repr__ (self)
 Returns the representation of this object as string. More...
 
def update (self, **kwargs)
 Update instance arguments. More...
 
def add2db (self)
 Add an object to the database. More...
 

Static Public Member Functions

def get (id=None, expired=False, share=None)
 Query Watch objects. More...
 

Static Public Attributes

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

Static Private Attributes

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

Detailed Description

Class to handle watch list entries.

Test:
tests.test_objects.TestObjects.test_Watch_objects()

Constructor & Destructor Documentation

◆ __init__()

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

◆ __str__()

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:

◆ get()

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()

◆ remove()

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(), smm.objects.DailyQuote.share, smm.objects.Watch.share, and smm.objects.SMMBaseObject.update().

Here is the call graph for this function:

Member Data Documentation

◆ __storm_table__

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

Use given table to store all of this class inside.

◆ arguments

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

◆ created

smm.objects.Watch.created = Date()
static

Date when the watch object is created.

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

◆ expire

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

Date when the watch object will be removed automatically.

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

◆ id

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

◆ notes

smm.objects.Watch.notes = Unicode()
static

Detailed notes.

◆ psTopic

string smm.objects.Watch.psTopic = 'smm.watch'
static

◆ share

smm.objects.Watch.share = Reference(id, Share.watch_id, on_remote=True)
static

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