odoo/openerp/osv
Vo Minh Thu 4dc26443d1 [MERGE] orm: cleand get_pg_type(). Changes as written in the merge prop.:
* Extracted creation of VARCHAR pg_type into a separate function, make missing 
  size (or size 0) create an unlimited VARCHAR field (effectively limited by
  postgres to 1GB data)
* Extracted fields to pg_types mapping outside of get_pg_type
* Made fields.function recursively forward to get_pg_type (via a type overload) 
  instead of reimplementing half get_pg_type in itself
* Simplified some get_pg_type cases

Note: if this is merged, it might be nice to convert fields.selection to use an 
API similar to fields.function: default to VARCHAR storage, if there's a type
attribute override use that type. Currently, fields.selection is handled the
following way:

* If the selection is a list and the type of the first half of the first item 
  is an integer, use type int4
* If the field has a __size=-1__ attribute, use type int4
* Else use type varchar (with size specified on the field, if any)

One change from previous version is that if type of the first half of the first 
item of the selection was str or unicode, it tried to find the longest string
and used that as the field's size. This meant silent loss of data if new,
longer items were added to the selection without recreating the whole db (or at
least manually altering the relevant fields). It also used the field's size or
*16* as a minimum default, for some reason, and if there was no size specified
on the selection (or size=0) it just hardcoded the size to 16.

bzr revid: vmt@openerp.com-20111006081336-uka6srvdmvs0s4lm
2011-10-06 10:13:36 +02:00
..
__init__.py API docs: settings file and titles at modules 2011-06-23 12:03:57 +03:00
expression.py [FIX] expression: we dont add any restriction on the main ids 2011-10-05 15:33:37 +02:00
fields.py [MERGE] fields.property: correctly tests for many2one/relative fields. 2011-10-06 09:47:53 +02:00
orm.py [MERGE] orm: cleand get_pg_type(). Changes as written in the merge prop.: 2011-10-06 10:13:36 +02:00
osv.py [MERGE] trunk 2011-10-01 03:22:10 +02:00
query.py API docs: settings file and titles at modules 2011-06-23 12:03:57 +03:00