|
View:
New views
12 Messages
—
Rating Filter:
Alert me
|
|
|
Error when accessing pylons.c.wHi guys I am following the tutorial from "Using ToscaWidgets to create Forms" [1], and I am getting the following error: AttributeError: 'str' object has no attribute 'form' just after my statement: pylons.c.w.form = create_movie_form If I change this line to: pylons.c.w = dict() pylons.c.w['form'] = create_movie_form Everything runs ok (the template has ``${tmpl_context.w.form()}`` inside it) So, what should be pylons.c.w ? a Bunch ? Who defines it ? I see mod/pylonshf.py from ToscaWidgets making use of ``getattr(pylons.c, 'w', None)``, but I couldn't find any initial setup of this object ``w``. Cheers, Roger [1] - http://turbogears.org/2.0/docs/main/ToscaWidgets/forms.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.wHey Roger, the documentation on: http://toscawidgets.org/documentation/tw.forms/tutorials/pylons_one.html is more updated, I think. At least it works for me :)
[]'s - Walter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.wHi Roger, The WidgetBunch is no more required and the widget may be directly stuck to the tmpl_context. So all pylons.c.w becomes pylons.c, i.e. pylons.c.form = create_movie_form and the widget can be obtained in the template directly from the tmpl_context as ${tmpl_context.form(value=value)} The docs seem to be not yet to be updated as this is a very recent change. Regards Sanjiv [1] http://docs.turbogears.org/2.0/RoughDocs/ToscaWidgets/Forms On Jun 26, 9:15 am, "Roger Demetrescu" <roger.demetre...@...> wrote: > Hi guys > > I am following the tutorial from "Using ToscaWidgets to create Forms" [1], > and I am getting the following error: > > AttributeError: 'str' object has no attribute 'form' > > just after my statement: > > pylons.c.w.form = create_movie_form > > If I change this line to: > > pylons.c.w = dict() > pylons.c.w['form'] = create_movie_form > > Everything runs ok (the template has ``${tmpl_context.w.form()}`` inside it) > > So, what should be pylons.c.w ? a Bunch ? Who defines it ? > I see mod/pylonshf.py from ToscaWidgets making use of > ``getattr(pylons.c, 'w', None)``, > but I couldn't find any initial setup of this object ``w``. > > Cheers, > > Roger > > [1] -http://turbogears.org/2.0/docs/main/ToscaWidgets/forms.html You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.wOops sorry for leaving the doc reference on the page. It has been removed :( Regards Sanjiv On Jun 26, 12:20 pm, Sanjiv <SinghSanj...@...> wrote: > Hi Roger, > > The WidgetBunch is no more required and the widget may be directly > stuck to the tmpl_context. So all pylons.c.w becomes pylons.c, i.e. > > pylons.c.form = create_movie_form > > and the widget can be obtained in the template directly from the > tmpl_context as > > ${tmpl_context.form(value=value)} > > The docs seem to be not yet to be updated as this is a very recent > change. > > Regards > Sanjiv > > [1]http://docs.turbogears.org/2.0/RoughDocs/ToscaWidgets/Forms > > On Jun 26, 9:15 am, "Roger Demetrescu" <roger.demetre...@...> > wrote: > > > Hi guys > > > I am following the tutorial from "Using ToscaWidgets to create Forms" [1], > > and I am getting the following error: > > > AttributeError: 'str' object has no attribute 'form' > > > just after my statement: > > > pylons.c.w.form = create_movie_form > > > If I change this line to: > > > pylons.c.w = dict() > > pylons.c.w['form'] = create_movie_form > > > Everything runs ok (the template has ``${tmpl_context.w.form()}`` inside it) > > > So, what should be pylons.c.w ? a Bunch ? Who defines it ? > > I see mod/pylonshf.py from ToscaWidgets making use of > > ``getattr(pylons.c, 'w', None)``, > > but I couldn't find any initial setup of this object ``w``. > > > Cheers, > > > Roger > > > [1] -http://turbogears.org/2.0/docs/main/ToscaWidgets/forms.html You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.wHi Walter and Sanjiv On Thu, Jun 26, 2008 at 04:20, Sanjiv <SinghSanjivK@...> wrote: > > Hi Roger, > > The WidgetBunch is no more required and the widget may be directly > stuck to the tmpl_context. So all pylons.c.w becomes pylons.c, i.e. > > pylons.c.form = create_movie_form > > and the widget can be obtained in the template directly from the > tmpl_context as > > ${tmpl_context.form(value=value)} > > The docs seem to be not yet to be updated as this is a very recent > change. Ok... I did a quick test today morning and it worked indeed... However, I am intrigued with the actual code of Toscawidget's mods/pylonshf.py =================== def _render_func_wrapper(func): ...cut... tw_extra_doc = """\ This version is a ToscaWidgets wrapper which collects resources in pylons.g.w and pylons.g.c and makies them available at pylons.c.resources so the base template can render them. It also sets the default_view if the engine name is overrided when calling me. """ =================== It seems it still looks at pylons.c.w and pylons.g.w... Is it only for compatibility ? I didn't test the form with a javascript/css resource. Are these resources been correctly collected ? (I'm not in from my own computer, so don't have the environment to do these tests) Cheers, Roger --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.wHi Roger, Roger Demetrescu wrote: > Hi Walter and Sanjiv > > > On Thu, Jun 26, 2008 at 04:20, Sanjiv <SinghSanjivK@...> wrote: > >> Hi Roger, >> >> The WidgetBunch is no more required and the widget may be directly >> stuck to the tmpl_context. So all pylons.c.w becomes pylons.c, i.e. >> >> pylons.c.form = create_movie_form >> >> and the widget can be obtained in the template directly from the >> tmpl_context as >> >> ${tmpl_context.form(value=value)} >> >> The docs seem to be not yet to be updated as this is a very recent >> change. >> BTW, you can also import widgets directy from the template. This is useful for JS or CSS Links or for widgets that don't submit any input (hence you don't need them in the controller to perform validation). Widgets that require js or css links will work correctly too. > > Ok... I did a quick test today morning and it worked indeed... > > However, I am intrigued with the actual code of Toscawidget's mods/pylonshf.py > > =================== > def _render_func_wrapper(func): > ...cut... > tw_extra_doc = """\ > This version is a ToscaWidgets wrapper which collects resources in > pylons.g.w and pylons.g.c and makies them available at pylons.c.resources > so the base template can render them. > > It also sets the default_view if the engine name is overrided when calling me. > """ > =================== > > > > It seems it still looks at pylons.c.w and pylons.g.w... Is it only for > compatibility ? > Yes, these are legacy functions. I should probably put a deprecation notice on them. > I didn't test the form with a javascript/css resource. Are these resources been > correctly collected ? > Yep, take a look here for the details: http://toscawidgets.org/documentation/ToscaWidgets/modules/resource_injector.html Alberto --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.wOn Thu, Jun 26, 2008 at 13:30, Alberto Valverde <alberto@...> wrote: >> I didn't test the form with a javascript/css resource. Are these resources been >> correctly collected ? >> > > Yep, take a look here for the details: > http://toscawidgets.org/documentation/ToscaWidgets/modules/resource_injector.html And indeed it works !! :) I did read the resource_injector... very interesting ! Thanks Alberto, []s Roger --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.w>>> The docs seem to be not yet to be updated as this is a very recent >>> change. They are now. Sorry about the not getting the docs update right away. --Mark Ramm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.wOn Fri, Jun 27, 2008 at 10:54, Mark Ramm <mark.mchristensen@...> wrote: > >>>> The docs seem to be not yet to be updated as this is a very recent >>>> change. > > They are now. > > Sorry about the not getting the docs update right away. Hi Mark, You really don't need to be sorry. You are already doing an excellent job with TG2. I really thank you for such effort. Regarding the "schedule for updating the online docs", is it doable to setup crontab to do this docs rebuild once or twice a day ? This manner you can have 1 task less to take care about.. :) Cheers, Roger --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.w> Hi Mark, > > You really don't need to be sorry. You are already doing an excellent > job with TG2. I really thank you for such effort. > > Regarding the "schedule for updating the online docs", is it doable to > setup crontab to do this docs rebuild once or twice a day ? > > This manner you can have 1 task less to take care about.. :) We're getting a new server setup, and I think this will be something we should do on that server (set a nightly cronjob to build new docs with sphinx and put them in a /dev docs directory. I'd expect that we'll put the docs for released versions up when we release them, and update them more manually, since we'd probably want to update them out of the branch for that release. --Mark Ramm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.wHi Sanjiv, > The WidgetBunch is no more required and the widget may be directly > stuck to the tmpl_context. So all pylons.c.w becomes pylons.c, i.e. > > pylons.c.form = create_movie_form > That's fine but what is recommended to do with the dbsprockets- generated cruds? There's still pylons.c.w that is set to empty string... Greetings, Giorgi --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Error when accessing pylons.c.wif you want c.w back for any reason add it in lib.base.
from toscawidgets.api import WidgetBunch Then inside the controller's __call__ method add: pylons.c.w = WidgetBunch()
On Sun, Jul 6, 2008 at 2:08 PM, iGL <Giorgi.Lekishvili@...> wrote:
-- Mark Ramm-Christensen email: mark at compoundthinking dot com blog: www.compoundthinking.com/blog --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@... To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free Forum Powered by Nabble | Forum Help |