[web2py] Re: Error on migrate=True
On Saturday, April 7, 2018 at 4:13:16 AM UTC-4, Stephan wrote: > > Anthony, 1kTHX, it works now. > The error was, that I set *migrate=True* in the DAL connector, i.e. *db > = DAL('credentials.ee@mysql', migrate=True)* but not in the table that > was altered. > So this works for me: > - I run the application with db = DAL('xxx@xyz', fake_migrate_all=True) > - I remove fake_migrate_all=True > - I add 'migrate=True' to the table where I added al line > I'm not sure what your original workflow was, but the "migrate" argument to DAL() simply determines the default value of "migrate" in each call to .define_table(), both of which default to True -- so explicitly setting either of them to True is equivalent to not setting them at all. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Error loging in after authentication changes
> > {{for q in question:}} > {{q=XML(q.quest.replace('\n','').replace('(','{').replace(')','}'), > sanitize=True)}} > {{pass}} > ... > $(function () { >... > sendMessage('{{=q}}'); > When "question" is empty (i.e., there are no answers from the current user), the variable "q" will not be defined in the for loop, and therefore will result in an exception later where you have {{=q}}. This doesn't have anything to do with @auth.has_membership('managers'), as the error is not even occurring in the function with that decorator. If you are expecting "question" to always include some records, you have to figure out why you aren't getting any in this case. Otherwise, adjust your code to account for the possibility of an empty "question". Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Error loging in after authentication changes
Also, there is not point to either of the for loops at the top of the view -- each loop is simply assigning a new value to the same variable, so the final value of the variable is just that of the final element in the iteration. You might as well just make that final assignment without bothering with iteration over all the previous items. Anthony On Saturday, April 7, 2018 at 10:34:28 AM UTC-4, Anthony wrote: > > {{for q in question:}} >> {{q=XML(q.quest.replace('\n','').replace('(','{').replace(')','}'), >> sanitize=True)}} >> {{pass}} >> ... >> $(function () { >>... >> > sendMessage('{{=q}}'); >> > > When "question" is empty (i.e., there are no answers from the current > user), the variable "q" will not be defined in the for loop, and therefore > will result in an exception later where you have {{=q}}. > > This doesn't have anything to do with @auth.has_membership('managers'), as > the error is not even occurring in the function with that decorator. If you > are expecting "question" to always include some records, you have to figure > out why you aren't getting any in this case. Otherwise, adjust your code to > account for the possibility of an empty "question". > > Anthony > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Error loging in after authentication changes
Thanks for the information. Let me work on it. On Sat, 7 Apr 2018, 17:36 Anthony wrote: > Also, there is not point to either of the for loops at the top of the view > -- each loop is simply assigning a new value to the same variable, so the > final value of the variable is just that of the final element in the > iteration. You might as well just make that final assignment without > bothering with iteration over all the previous items. > > Anthony > > On Saturday, April 7, 2018 at 10:34:28 AM UTC-4, Anthony wrote: >> >> {{for q in question:}} >>> {{q=XML(q.quest.replace('\n','').replace('(','{').replace(')','}'), >>> sanitize=True)}} >>> {{pass}} >>> ... >>> $(function () { >>>... >>> >> sendMessage('{{=q}}'); >>> >> >> When "question" is empty (i.e., there are no answers from the current >> user), the variable "q" will not be defined in the for loop, and therefore >> will result in an exception later where you have {{=q}}. >> >> This doesn't have anything to do with @auth.has_membership('managers'), >> as the error is not even occurring in the function with that decorator. If >> you are expecting "question" to always include some records, you have to >> figure out why you aren't getting any in this case. Otherwise, adjust your >> code to account for the possibility of an empty "question". >> >> Anthony >> > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/web2py/YQhEantsews/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Did results of form.custom.dspval[fieldname] change?
I just installed the latest web2py. Version 2.16.1-stable+timestamp.2018.03.08.10.23.01 Previously, in my view I could test whether or not a form field had a value by: {{if form.custom.dspval[fieldname]:}} {{=form.custom.dspval[fieldname] {{else:}} click here to enter field value {{pass}} But now it appears as though form.custom.dspval[fieldname] returns instead of an empty string. It is entirely possible that this has always worked this way, but all of a sudden a bunch of my code is breaking. Short of that, can someone point me to the right way to install a previous version of web2py along with the proper pyDal? Any help (especially on a Saturday) would really be appreciated. -Jim -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Decrypt password from auth_user
You don't need to show the "correct" number of s. No one else does so there will not be any confusion. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.