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.Exchange Class Reference

Class to handle Exchange data. More...

Inheritance diagram for smm.objects.Exchange:

Public Member Functions

def __str__
 Returns the content of this instance as string.
- 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 Exchange objects.
def getCount
 Returns the number of known exchanges.

Static Public Attributes

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

Detailed Description

Class to handle Exchange data.

Test:
tests.test_objects.TestObjects.test_Exchange_objects()

Member Function Documentation

def smm.objects.Exchange.__str__ (   self)

Returns the content of this instance as string.

References smm.objects.SMMBaseObject._encode(), smm.objects.Exchange.description, smm.objects.Exchange.id, and smm.objects.Exchange.symbol.

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.Exchange.get (   id = None,
  symbol = None,
  city = None 
)
static

Query Exchange objects.

There are three ways for querying objects:

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

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

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

To balance the diffenent 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()
def smm.objects.Exchange.getCount ( )
static

Returns the number of known exchanges.

Member Data Documentation

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

Use given table to store all of this class inside.

dictionary smm.objects.Exchange.arguments
static
Initial value:
{
'symbol': 'unicode',
'description': 'unicode',
}
tuple smm.objects.Exchange.description = Unicode()
static

The full name and country of the exchange.

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

tuple smm.objects.Exchange.id = Int(default=AutoReload, primary=True)
static
string smm.objects.Exchange.psTopic = 'smm.exchange'
static
tuple 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: