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

Class to handle Exchange data. More...

Inheritance diagram for smm.objects.Exchange:

Public Member Functions

def __str__ (self)
 Returns the content of this instance as string. 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, symbol=None, city=None)
 Query Exchange objects. More...
 
def getCount ()
 Returns the number of known exchanges. More...
 

Static Public Attributes

dictionary arguments
 
string psTopic = "smm.exchange"
 
 id = Int(default=AutoReload, primary=True)
 Unique ID for each object. More...
 
 symbol = Unicode()
 Unique symbol for each exchange. More...
 
 description = Unicode()
 The full name and country of the exchange. 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_exchange"
 Use given table to store all of this class inside. More...
 

Detailed Description

Class to handle Exchange data.

Test:
tests.test_objects.TestObjects.test_Exchange_objects()

Member Function Documentation

◆ __str__()

def smm.objects.Exchange.__str__ (   self)

Returns the content of this instance as string.

References smm.objects.Exchange.description, smm.objects.Currency.description, 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, smm.objects.Exchange.symbol, and smm.objects.Share.symbol.

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

Here is the caller graph for this function:

◆ get()

def smm.objects.Exchange.get (   id = None,
  symbol = None,
  city = None 
)
static

Query Exchange objects.

There are three ways for querying objects:

  • Querying by id returns an Exchange object or None
  • Querying by symbol returns an Exchange object or None
  • Querying without parameters to get all Exchange objects

The last way returns always a storm.store.ResultSet.

Parameters
idReturns an Exchange specified by id.
symbolReturns an Exchange specified by symbol.
cityReturns an Exchange specified by city.
Searching for city:
Searching to an exchange specified by the city parameter searches the database currently SQLite using the LIKE operator.

To balance the different behaviour of LIKE between ascii and unicode sequences. The city parameter is always capitalised.

SQLite documentation of the LIKE operator:
The default behavior of the LIKE operator is to ignore case for ASCII characters. Hence, by default 'a' LIKE 'A' is true. The case_sensitive_like pragma installs a new application-defined LIKE function that can change this behavior. When case_sensitive_like is enabled, 'a' LIKE 'A' is false but 'a' LIKE 'a' is still true.
Sorting:
The result are unsorted
Test:
tests.test_objects.TestObjects.test_Exchange_get()

◆ getCount()

def smm.objects.Exchange.getCount ( )
static

Returns the number of known exchanges.

Member Data Documentation

◆ __storm_table__

string smm.objects.Exchange.__storm_table__ = "t_exchange"
staticprivate

Use given table to store all of this class inside.

◆ arguments

dictionary smm.objects.Exchange.arguments
static
Initial value:
= {
"symbol",
"description",
}

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

◆ description

smm.objects.Exchange.description = Unicode()
static

The full name and country of the exchange.

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

◆ id

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

◆ psTopic

string smm.objects.Exchange.psTopic = "smm.exchange"
static

◆ symbol

smm.objects.Exchange.symbol = Unicode()
static

Unique symbol for each exchange.

Referenced by smm.objects.Exchange.__str__(), and smm.objects.Share.__str__().


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