pandas row data to webform

Solutions on MaxInterview for pandas row data to webform by the best coders in the world

showing results for - "pandas row data to webform"
Charlie
26 Sep 2017
1def _getFields(obj, tree=None, retval=None, fileobj=None):
2    fieldAttributes = {'/FT': 'Field Type', '/Parent': 'Parent', '/T': 'Field Name', 
3    '/TU': 'Alternate Field Name', '/TM': 'Mapping Name', '/Ff': 'Field Flags', 
4    '/V': 'Value', '/DV': 'Default Value'}
5    if retval is None:
6        retval = OrderedDict()
7        catalog = obj.trailer["/Root"]
8        if "/AcroForm" in catalog:
9            tree = catalog["/AcroForm"]
10        else:
11            return None
12    if tree is None:
13        return retval
14
15    obj._checkKids(tree, retval, fileobj)
16    for attr in fieldAttributes:
17        if attr in tree:
18            obj._buildField(tree, retval, fileobj, fieldAttributes)
19            break
20
21    if "/Fields" in tree:
22        fields = tree["/Fields"]
23        for f in fields:
24            field = f.getObject()
25            obj._buildField(field, retval, fileobj, fieldAttributes)
26
27    return retval
28