Author: cito
Date: Thu Nov 26 15:03:45 2015
New Revision: 638
Log:
Update the documentation
Modified:
branches/4.x/docs/changelog.txt
branches/4.x/docs/classic.txt
trunk/docs/changelog.txt
trunk/docs/classic.txt
Modified: branches/4.x/docs/changelog.txt
==============================================================================
--- branches/4.x/docs/changelog.txt Thu Nov 26 14:32:15 2015 (r637)
+++ branches/4.x/docs/changelog.txt Thu Nov 26 15:03:45 2015 (r638)
@@ -6,8 +6,8 @@
- Set a better default for the user option "escaping-funcs".
- Greatly improve unit testing.
- Force build to compile with no errors.
-- Fix decimal point handling
-- Add option to return money as string
+- Fix decimal point handling.
+- Add option to return boolean values as bool objects.
- Fix notification handler (Thanks Patrick TJ McPhee).
Version 4.1.1 (2013-01-08)
Modified: branches/4.x/docs/classic.txt
==============================================================================
--- branches/4.x/docs/classic.txt Thu Nov 26 14:32:15 2015 (r637)
+++ branches/4.x/docs/classic.txt Thu Nov 26 15:03:45 2015 (r638)
@@ -368,6 +368,25 @@
"select img from pictures where name='Garfield'").getresult[0][0])
file('garfield.gif', 'wb').write(picture)
+get_decimal
+-----------
+get the decimal type to be used for numeric values
+
+Syntax::
+
+ get_decimal()
+
+Parameters:
+ None
+
+Return type:
+ :cls: the Python class used for PostgreSQL numeric values
+
+Description:
+ This function returns the Python class that is used by PyGreSQL to hold
+ PostgreSQL numeric values. The default class is decimal.Decimal if
+ available, otherwise the float type is used.
+
set_decimal
-----------
set a decimal type to be used for numeric values
@@ -383,7 +402,107 @@
This function can be used to specify the Python class that shall be
used by PyGreSQL to hold PostgreSQL numeric values. The default class
is decimal.Decimal if available, otherwise the float type is used.
-
+
+get_decimal_point
+-----------------
+get the decimal mark used for monetary values
+
+Syntax::
+
+ get_decimal_point()
+
+Parameters:
+ None
+
+Return type:
+ :str: string with one character representing the decimal mark
+
+Description:
+ This function returns the decimal mark used by PyGreSQL to interpret
+ PostgreSQL monetary values when converting them to decimal numbers.
+ The default setting is '.' as a decimal point. This setting is not
+ adapted automatically to the locale used by PostGreSQL, but you can
+ use `set_decimal()` to set a different decimal mark manually. A return
+ value of `None` means monetary values are not interpreted as decimal
+ numbers, but returned as strings including the formatting and currency.
+
+set_decimal_point
+-----------------
+specify which decimal mark is used for interpreting monetary values
+
+Syntax::
+
+ set_decimal_point(str)
+
+Parameters:
+ :str: string with one character representing the decimal mark
+
+Description:
+ This function can be used to specify the decimal mark used by PyGreSQL
+ to interpret PostgreSQL monetary values. The default value is '.' as
+ a decimal point. This value is not adapted automatically to the locale
+ used by PostGreSQL, so if you are dealing with a database set to a
+ locale that uses a ',' instead of '.' as the decimal point, then you
+ need to call `set_decimal(',')` to have PyGreSQL interpret monetary
+ values correctly. If you don't want money values to be converted to
+ decimal numbers, then you can call `set_decimal(None)`, which will
+ cause PyGreSQL to return monetary values as strings including their
+ formatting and currency.
+
+get_bool
+--------
+check whether boolean values are returned as bool objects
+
+Syntax::
+
+ get_bool()
+
+Parameters:
+ None
+
+Return type:
+ :bool: whether or not bool objects will be returned
+
+Description:
+ This function checks whether PyGreSQL returns PostgreSQL boolean
+ values converted to Python bool objects, or as 'f' and 't' strings
+ which are the values used internally by PostgreSQL. By default,
+ conversion to bool objects is not activated, but you can enable
+ this with the `set_bool()` method.
+
+set_bool
+--------
+set whether boolean values are returned as bool objects
+
+Syntax::
+
+ set_bool(bool)
+
+Parameters:
+ :bool: whether or not bool objects shall be returned
+
+Description:
+ This function can be used to specify whether PyGreSQL shall return
+ PostgreSQL boolean values converted to Python bool objects, or as
+ 'f' and 't' strings which are the values used internally by PostgreSQL.
+ By default, conversion to bool objects is not activated, but you can
+ enable this by calling `set_bool(True)`.
+
+get_namedresult
+---------------
+set a function that will convert to named tuples
+
+Syntax::
+
+ set_namedresult()
+
+Parameters:
+ None
+
+Description:
+ This function returns the function used by PyGreSQL to construct the
+ result of the `query.namedresult()` method.
+
set_namedresult
---------------
set a function that will convert to named tuples
@@ -396,7 +515,8 @@
:func: the function to be used to convert results to named tuples
Description:
- You can use this if you want to create different kinds of named tuples.
+ You can use this if you want to create different kinds of named tuples
+ returned by the `query.namedresult()` method.
Module constants
Modified: trunk/docs/changelog.txt
==============================================================================
--- trunk/docs/changelog.txt Thu Nov 26 14:32:15 2015 (r637)
+++ trunk/docs/changelog.txt Thu Nov 26 15:03:45 2015 (r638)
@@ -6,8 +6,9 @@
- Set a better default for the user option "escaping-funcs".
- Greatly improve unit testing.
- Force build to compile with no errors.
-- Fix decimal point handling
-- Add option to return money as string
+- Fix decimal point handling.
+- Add option to return boolean values as bool objects.
+- Add option to return money values as string.
- Fix notification handler (Thanks Patrick TJ McPhee).
Version 4.1.1 (2013-01-08)
Modified: trunk/docs/classic.txt
==============================================================================
--- trunk/docs/classic.txt Thu Nov 26 14:32:15 2015 (r637)
+++ trunk/docs/classic.txt Thu Nov 26 15:03:45 2015 (r638)
@@ -368,6 +368,25 @@
"select img from pictures where name='Garfield'").getresult[0][0])
file('garfield.gif', 'wb').write(picture)
+get_decimal
+-----------
+get the decimal type to be used for numeric values
+
+Syntax::
+
+ get_decimal()
+
+Parameters:
+ None
+
+Return type:
+ :cls: the Python class used for PostgreSQL numeric values
+
+Description:
+ This function returns the Python class that is used by PyGreSQL to hold
+ PostgreSQL numeric values. The default class is decimal.Decimal if
+ available, otherwise the float type is used.
+
set_decimal
-----------
set a decimal type to be used for numeric values
@@ -383,7 +402,107 @@
This function can be used to specify the Python class that shall be
used by PyGreSQL to hold PostgreSQL numeric values. The default class
is decimal.Decimal if available, otherwise the float type is used.
-
+
+get_decimal_point
+-----------------
+get the decimal mark used for monetary values
+
+Syntax::
+
+ get_decimal_point()
+
+Parameters:
+ None
+
+Return type:
+ :str: string with one character representing the decimal mark
+
+Description:
+ This function returns the decimal mark used by PyGreSQL to interpret
+ PostgreSQL monetary values when converting them to decimal numbers.
+ The default setting is '.' as a decimal point. This setting is not
+ adapted automatically to the locale used by PostGreSQL, but you can
+ use `set_decimal()` to set a different decimal mark manually. A return
+ value of `None` means monetary values are not interpreted as decimal
+ numbers, but returned as strings including the formatting and currency.
+
+set_decimal_point
+-----------------
+specify which decimal mark is used for interpreting monetary values
+
+Syntax::
+
+ set_decimal_point(str)
+
+Parameters:
+ :str: string with one character representing the decimal mark
+
+Description:
+ This function can be used to specify the decimal mark used by PyGreSQL
+ to interpret PostgreSQL monetary values. The default value is '.' as
+ a decimal point. This value is not adapted automatically to the locale
+ used by PostGreSQL, so if you are dealing with a database set to a
+ locale that uses a ',' instead of '.' as the decimal point, then you
+ need to call `set_decimal(',')` to have PyGreSQL interpret monetary
+ values correctly. If you don't want money values to be converted to
+ decimal numbers, then you can call `set_decimal(None)`, which will
+ cause PyGreSQL to return monetary values as strings including their
+ formatting and currency.
+
+get_bool
+--------
+check whether boolean values are returned as bool objects
+
+Syntax::
+
+ get_bool()
+
+Parameters:
+ None
+
+Return type:
+ :bool: whether or not bool objects will be returned
+
+Description:
+ This function checks whether PyGreSQL returns PostgreSQL boolean
+ values converted to Python bool objects, or as 'f' and 't' strings
+ which are the values used internally by PostgreSQL. By default,
+ conversion to bool objects is not activated, but you can enable
+ this with the `set_bool()` method.
+
+set_bool
+--------
+set whether boolean values are returned as bool objects
+
+Syntax::
+
+ set_bool(bool)
+
+Parameters:
+ :bool: whether or not bool objects shall be returned
+
+Description:
+ This function can be used to specify whether PyGreSQL shall return
+ PostgreSQL boolean values converted to Python bool objects, or as
+ 'f' and 't' strings which are the values used internally by PostgreSQL.
+ By default, conversion to bool objects is not activated, but you can
+ enable this by calling `set_bool(True)`.
+
+get_namedresult
+---------------
+set a function that will convert to named tuples
+
+Syntax::
+
+ set_namedresult()
+
+Parameters:
+ None
+
+Description:
+ This function returns the function used by PyGreSQL to construct the
+ result of the `query.namedresult()` method.
+
set_namedresult
---------------
set a function that will convert to named tuples
@@ -396,7 +515,8 @@
:func: the function to be used to convert results to named tuples
Description:
- You can use this if you want to create different kinds of named tuples.
+ You can use this if you want to create different kinds of named tuples
+ returned by the `query.namedresult()` method.
Module constants
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql