Now this is better and I can make a patch,

Do you think SQLTABLE should use the defined field labels by default if
headers param is empty?

<code>
        if not columns:
            columns = sqlrows.colnames

        if headers=='fieldname:capitalize':
            headers = {}
            for c in columns:
                headers[c] = ' '.join([w.capitalize() for w in
c.split('.')[-1].split('_')])

        if not headers or headers=='labels':
            headers = {}
            for c in columns:
                (t,f) = c.split('.')
                field = sqlrows.db[t][f]
                if hasattr(field,'label'):
                    headers[c] = field.label
                else:
                    lbl = c.split('.')[1].replace("_", " ").capitalize()
                    headers[c] = lbl

</code>
-- 

Bruno Rocha
http://about.me/rochacbruno/bio

Reply via email to