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 = ""
 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.


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.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 

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

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.
The result are unsorted

◆ getCount()

def smm.objects.Exchange.getCount ( )

Returns the number of known exchanges.

Member Data Documentation

◆ __storm_table__

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

Use given table to store all of this class inside.

◆ arguments

dictionary smm.objects.Exchange.arguments
Initial value:
= {

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

◆ description

smm.objects.Exchange.description = Unicode()

The full name and country of the exchange.

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

◆ id = Int(default=AutoReload, primary=True)

◆ psTopic

string smm.objects.Exchange.psTopic = ""

◆ symbol

smm.objects.Exchange.symbol = Unicode()

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: