Thanks for looking.

Code runs without errors in v1.96.1 but throws an error on 1.97.1.
Here's the traceback:

Traceback (most recent call last):
  File "/home/rwn/Projects/web2py/gluon/restricted.py", line 192, in
restricted
    exec ccode in environment
  File "/home/rwn/Projects/web2py/applications/bbc/controllers/
donor.py", line 418, in <module>
  File "/home/rwn/Projects/web2py/gluon/globals.py", line 137, in
<lambda>
    self._caller = lambda f: f()
  File "/home/rwn/Projects/web2py/gluon/tools.py", line 2415, in f
    return action(*a, **b)
  File "/home/rwn/Projects/web2py/applications/bbc/controllers/
donor.py", line 62, in address
    ,'address.country':'Country'})
  File "/home/rwn/Projects/web2py/gluon/tools.py", line 3225, in
select
    return SQLTABLE(rows,headers=headers,**attr)
  File "/home/rwn/Projects/web2py/gluon/sqlhtml.py", line 1453, in
__init__
    if isinstance(headers[colname],dict):
KeyError: 'address.line_3'

In prior versions, web2py will not complain about missing label and
just use the field name (or label in table definition) instead. I
suppose this new behavior is the "right way" of doing it and I should
just adjust the code accordingly, but IMO the old behavior handles the
issue more elegantly.


On Jul 7, 3:11 pm, Bruno Rocha <rochacbr...@gmail.com> wrote:
> Can you share some example app or model + controller code t reproduce the
> bug.
>
> Do you have a Traceback ticket error? what message, what file/line?
>
> The erro occurs when running the mentioned controller, or qhen doing some
> other action on this?
>
> Need more onfo to help tracking this issue.
>
> []'s
>
>
>
>
>
>
>
>
>
> On Thu, Jul 7, 2011 at 2:50 AM, niknok <nikolai...@gmail.com> wrote:
> > **
> > While using crud, I sometimes define headers for *some* fields listed in
> > the fields argument. This works until I upgraded to 1.97.1 and now I get an
> > error if I do not define the headers for *all* fields listed in the fields
> > argument.
>
> > For example, the following code no longer works
>
> > rows=crud.select(db.address
> >                     ,query=((db.address.owner_is==address_owner)&
> >                             
> > (db.address.owner_is_person==address_owner_is_person))
> >                     ,fields=['address.id'
> >                                 ,'address.line_1'
> >                                 ,'address.is_type'
> >                                 ,'address.country']
> >                     ,headers={'address.id':'#'
> >                                 ,'address.line_1':'Street address'
> >                                 ,'address.country':'Country'})
>
> > until I add a header for address.is_type, too.
>
> > Is this a bug or a new feature?
>
> --
>
> --
> Bruno Rocha
> [ About me:http://zerp.ly/rochacbruno]
> [ Aprenda a programar:http://CursoDePython.com.br]
> [ O seu aliado nos cuidados com os animais:http://AnimalSystem.com.br]
> [ Consultoria em desenvolvimento web:http://www.blouweb.com]

Reply via email to