comparison MySQLdb/converters.py @ 15:a275593a1630 MySQLdb

More doc fixes
author adustman
date Mon, 26 Feb 2007 18:59:22 +0000
parents 7773efbe9b30
children e7bd07afbcb9
comparison
equal deleted inserted replaced
14:7773efbe9b30 15:a275593a1630
1 """MySQLdb type conversion module 1 """
2 MySQLdb type conversion module
3 ------------------------------
2 4
3 This module handles all the type conversions for MySQL. If the default 5 This module handles all the type conversions for MySQL. If the default type
4 type conversions aren't what you need, you can make your own. The 6 conversions aren't what you need, you can make your own. The dictionary
5 dictionary conversions maps some kind of type to a conversion function 7 conversions maps some kind of type to a conversion function which returns the
6 which returns the corresponding value: 8 corresponding value:
7 9
8 Key: FIELD_TYPE.* (from MySQLdb.constants) 10 Key: FIELD_TYPE.* (from MySQLdb.constants)
9 11
10 Conversion function: 12 Conversion function:
11 13
20 Arguments: Python object of indicated type or class AND 22 Arguments: Python object of indicated type or class AND
21 conversion dictionary 23 conversion dictionary
22 24
23 Returns: SQL literal value 25 Returns: SQL literal value
24 26
25 Notes: Most conversion functions can ignore the dictionary, but 27 Notes: Most conversion functions can ignore the dictionary, but it is a
26 it is a required parameter. It is necessary for converting 28 required parameter. It is necessary for converting things like sequences
27 things like sequences and instances. 29 and instances.
28 30
29 Don't modify conversions if you can avoid it. Instead, make copies 31 Don't modify conversions if you can avoid it. Instead, make copies
30 (with the copy() method), modify the copies, and then pass them to 32 (with the copy() method), modify the copies, and then pass them to
31 MySQL.connect(). 33 MySQL.connect().
32 34