~oerplib/oerplib/trunk-inspect-modules

« back to all changes in this revision

Viewing changes to oerplib/service/inspect/on_change.py

  • Committer: Sébastien Alix
  • Date: 2013-05-15 14:59:07 UTC
  • Revision ID: sebastien.alix@osiell.com-20130515145907-dct0nzy747m75j7b
Result returned by 'OERP.inspect.list_on_change()' changed + Documentation updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
            args = [arg.strip() for arg in match.group(2).split(',')]
48
48
            field = elt.attrib['name']
49
49
            if func not in result[model]:
50
 
                result[model][func] = {
51
 
                    'args': [],
52
 
                    'fields': [],
53
 
                    'views': [],
54
 
                }
55
 
            if field not in result[model][func]['fields']:
56
 
                result[model][func]['fields'].append(field)
57
 
            if view_name not in result[model][func]['views']:
58
 
                result[model][func]['views'].append(view_name)
59
 
            # We keep the longest signature found for this on_change
60
 
            if not result[model][func]['args'] \
61
 
                    or len(result[model][func]['args']) < len(args):
 
50
                result[model][func] = {}
 
51
            if view_name not in result[model][func]:
 
52
                result[model][func][view_name] = {}
 
53
            if field not in result[model][func][view_name]:
 
54
                result[model][func][view_name][field] = []
 
55
            if args and args not in result[model][func][view_name][field]:
62
56
                args = map(_clean_arg, args)
63
 
                result[model][func]['args'] = args
 
57
                result[model][func][view_name][field] = args
64
58
    # Scan recursively all other sub-descriptions defined in the view
65
59
    for field_name, field_data in view_data['fields'].iteritems():
66
60
        if field_data.get('views') and field_data['views'].get('form'):