Part of vmc.contrib.axiom.attributes View In Hierarchy
Known subclasses: vmc.contrib.axiom.attributes.point10decimal, vmc.contrib.axiom.attributes.point1decimal, vmc.contrib.axiom.attributes.point2decimal, vmc.contrib.axiom.attributes.point3decimal, vmc.contrib.axiom.attributes.point4decimal, vmc.contrib.axiom.attributes.point5decimal, vmc.contrib.axiom.attributes.point6decimal, vmc.contrib.axiom.attributes.point7decimal, vmc.contrib.axiom.attributes.point8decimal, vmc.contrib.axiom.attributes.point9decimal
Attribute representing a number with a specified number of decimal places. This is stored in SQLite as a binary integer multiplied by (10**N) where N is the number of decimal places required by Python. Therefore, in-database multiplication, division, or queries which compare to integers or fixedpointdecimals with a different number of decimal places, will not work. Also, you cannot store, or sum to, fixed point decimals greater than (2**63)/(10**N). While L{ieee754_double} is handy for representing various floating-point numbers, such as scientific measurements, this class (and the associated Python decimal class) is more appropriate for arithmetic on sums of money. For more information on Python's Decimal class: http://www.python.org/doc/current/lib/module-decimal.html and on general computerized Decimal math in general: http://www2.hursley.ibm.com/decimal/decarith.html This is currently a private helper superclass because we cannot store additional metadata about column types; maybe we should fix that. @cvar decimalPlaces: the number of points of decimal precision allowed by the storage and retrieval of this class. *Points beyond this number will be silently truncated to values passed into the database*, so be sure to select a value appropriate to your application!
Method | __init__ | Undocumented |
Method | infilter | used to convert a Python value to something that lives in the database; |
Method | outfilter | used to convert an SQL value to something that lives in memory; so |
Method | compare | Override this in a subclass. |
Inherited from SQLAttribute (via integer):
Method | computeDefault | Undocumented |
Method | reprFor | Undocumented |
Method | getShortColumnName | |
Method | getColumnName | |
Method | prepareInsert | Override this method to do something to an item to prepare for its |
Method | coercer | must return a value equivalent to the data being passed in for it to be |
Method | requiredSlots | Undocumented |
Method | fullyQualifiedName | |
Method | __repr__ | Undocumented |
Method | type | Undocumented |
Method | __get__ | |
Method | loaded | Undocumented |
Method | _convertPyval | Convert a Python value to a value suitable for inserting into the database. |
Method | __set__ | Undocumented |
Inherited from _ContainableMixin (via integer, SQLAttribute, Comparable):
Method | oneOf | Choose items whose attributes are in a fixed set. |
Method | notOneOf | Undocumented |
Inherited from _ComparisonOperatorMuxer (via integer, SQLAttribute, Comparable):
Method | __eq__ | Undocumented |
Method | __ne__ | Undocumented |
Method | __gt__ | Undocumented |
Method | __lt__ | Undocumented |
Method | __ge__ | Undocumented |
Method | __le__ | Undocumented |
Inherited from _MatchingOperationMuxer (via integer, SQLAttribute, Comparable):
Method | _like | Undocumented |
Method | like | Undocumented |
Method | notLike | Undocumented |
Method | startswith | Undocumented |
Method | endswith | Undocumented |
Inherited from _OrderingMixin (via integer, SQLAttribute, Comparable):
Method | _asc | Undocumented |
Method | _desc | Undocumented |