[web2py] Re: headers argument behavior in v1.97.1
I do not think this is the case. The thread is one year old and SQLTABLE got better. Anyway, perhaps I misunderstand you. Please post an example of behavior that you think should be changed. On Tuesday, 31 July 2012 11:06:49 UTC-5, Oskari wrote: > > Why do you have to define all headers? I would only want to display the > headers to those columns that I define in the columns list but now it > requires me to set headers to every other column too that I'm not showing. > That is stupid > > On Friday, 8 July 2011 04:17:39 UTC+2, ニコノコ wrote: >> >> Nope, I'm not using trunk. >> >> And yes, now I know that I have do define *all* the headers while in >> the old versions, that isn't a requirement. I guess it's part of being >> explicit.. >> >> On Jul 7, 6:36 pm, Martín Mulone wrote: >> > Did you use trunk version?, I submitted recently some changes there.- >> > >> > 2011/7/7 Bruno Rocha >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > > 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 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] >> > >> > -- >> > http://martin.tecnodoc.com.ar > > --
[web2py] Re: headers argument behavior in v1.97.1
Why do you have to define all headers? I would only want to display the headers to those columns that I define in the columns list but now it requires me to set headers to every other column too that I'm not showing. That is stupid On Friday, 8 July 2011 04:17:39 UTC+2, ニコノコ wrote: > > Nope, I'm not using trunk. > > And yes, now I know that I have do define *all* the headers while in > the old versions, that isn't a requirement. I guess it's part of being > explicit.. > > On Jul 7, 6:36 pm, Martín Mulone wrote: > > Did you use trunk version?, I submitted recently some changes there.- > > > > 2011/7/7 Bruno Rocha > > > > > > > > > > > > > > > > > > > > > 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 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] > > > > -- > > http://martin.tecnodoc.com.ar --
[web2py] Re: headers argument behavior in v1.97.1
Nope, I'm not using trunk. And yes, now I know that I have do define *all* the headers while in the old versions, that isn't a requirement. I guess it's part of being explicit.. On Jul 7, 6:36 pm, Martín Mulone wrote: > Did you use trunk version?, I submitted recently some changes there.- > > 2011/7/7 Bruno Rocha > > > > > > > > > > > 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 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] > > -- > http://martin.tecnodoc.com.ar
[web2py] Re: headers argument behavior in v1.97.1
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 File "/home/rwn/Projects/web2py/gluon/globals.py", line 137, in 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 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 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]