I Just tested this with Inner Joins and Left Outer Joins, works ok. 2010/12/9 mdipierro <[email protected]>
> This is now partially in trunk but default has not changed. What if > you are printing the result of a join? > > On Dec 8, 7:40 pm, Bruno Rocha <[email protected]> wrote: > > 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 Rochahttp://about.me/rochacbruno/bio > -- Bruno Rocha http://about.me/rochacbruno/bio

