|
Share and Money Management 0.18devel
|
Class to handle watch list entries. More...
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... | |
| id = None | |
| Unique ID for each object. More... | |
Static Private Attributes | |
| string | __storm_table__ = "t_watch" |
| Use given table to store all of this class inside. More... | |
Class to handle watch list entries.
| def smm.objects.Watch.__init__ | ( | self, | |
| share, | |||
created = datetime.date.today(), |
|||
expire = None, |
|||
notes = None |
|||
| ) |
Create a new Watch instance.
| self | The object instance itself |
| share | Share to watch (smm.objects.Share object) |
| created | Creation date (datetime.date object, default: today) |
| expire | Expiration date (datetime.date object, default: no expiration) |
| notes | Comment to the entry (default: None) |
Reimplemented from smm.objects.SMMBaseObject.
References gui.dialogs.DlgTrade.share, gui.dialogs.DlgShare.share, smm.objects.DailyQuote.share, smm.objects.Watch.share, and smm.objects.Position.share.
| def smm.objects.Watch.__str__ | ( | self | ) |
Returns the content of this instance as string.
References smm.objects.Watch.created, smm.objects.Watch.expire, smm.objects.SMMBaseObject.id, 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.Position.id, gui.dialogs.DlgTrade.share, gui.dialogs.DlgShare.share, smm.objects.DailyQuote.share, smm.objects.Watch.share, and smm.objects.Position.share.
Referenced by smm.objects.SMMBaseObject.__repr__().
|
static |
Query Watch objects.
There are three ways for querying objects:
id returns a Watch object or None share and/or expired The last two ways returns always a storm.store.ResultSet.
| id | Returns a watch list entry specified by id. |
| expired | Boolean flag to returns all expired watch list entries. |
| share | Returns a watch list entry specified by share. |
| 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(), gui.dialogs.DlgTrade.share, gui.dialogs.DlgShare.share, smm.objects.DailyQuote.share, smm.objects.Watch.share, smm.objects.Position.share, and smm.objects.SMMBaseObject.update().
|
staticprivate |
Use given table to store all of this class inside.
|
static |
Referenced by smm.objects.SMMBaseObject._setAttrs().
|
static |
Date when the watch object is created.
Referenced by smm.objects.Watch.__str__().
|
static |
Date when the watch object will be removed automatically.
Referenced by smm.objects.Watch.__str__().
|
static |
Unique ID for each object.
Referenced by smm.objects.Exchange.__str__(), smm.objects.Currency.__str__(), smm.objects.Share.__str__(), smm.objects.DailyQuote.__str__(), smm.objects.Transaction.__str__(), smm.objects.Watch.__str__(), smm.objects.Position.__str__(), smm.objects.SMMBaseObject._remove(), and smm.objects.Transaction.getVolume().
|
static |
Detailed notes.
|
static |
|
static |
Reference to the Share object
This uses a backwards references to prevent trouble with cross- references
Referenced by smm.objects.Watch.__init__(), smm.objects.DailyQuote.__str__(), smm.objects.Watch.__str__(), smm.objects.Position.__str__(), gui.dialogs.DlgTrade._prepareBuy(), gui.dialogs.DlgShare._processInput(), gui.dialogs.DlgShare._setShare(), gui.dialogs.DlgShare._validateInput(), smm.objects.Position.getLastQuote(), smm.objects.Position.getPerf(), gui.dialogs.DlgTrade.OnUpdateExistingPosition(), gui.dialogs.DlgTrade.OnUpdateNewPosition(), smm.objects.Watch.remove(), and smm.objects.Position.split().