On 2012-01-24 at 07:59:28 GMT kenneth gonsalves <lawgon@...> writes:
> On Tue, 2012-01-24 at 07:46 +0000, VK Sameer wrote:
> > return sorted([(k,k) for k,v in fields.__dict__.iteritems()
>
> should this not be:
>
> return sorted([(k,v) for k,v in fields.__dict__.iteritems()
I honestly don't know the code and am operating at a syntactic-correctness level
rather than semantic-correctness level.
But, yes, return (k,k) does seem to be throwing away the value part of the
dictionary after iterating through it.
The return value of _get_fields_type() is used thus:
class ir_model_fields(osv.osv):
...
_columns = {
...
'ttype': fields.selection(_get_fields_type, 'Field Type',size=64,
required=True),
...
and a sample use of ttype in turn is:
if vals.get('ttype', False) == 'selection':
Not sure if that gives any clues?
An older version of _get_fields_type() has:
cr.execute('select distinct ttype,ttype from ir_model_fields')
so maybe return (k,k) is OK?
Thanks,
Sameer
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc