[web2py] what can I do with this error: Getaadrinfo Failed.
When trying to custom pack and download my app as .exe, I get this error: [Errno socket error] [Errno 11004] getaddrinfo failed How can I resolve it? -- 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: Autocomplete widget don't respect other values in request.vars
It won't always be desirable to preserve the original query string because the Ajax callback is not really requesting the original parent page but instead merely using the original action to access the autocomplete functionality. However, it would probably be a good idea to add an option to the autocomplete widget allowing the query string to be preserved, so you should submit a github issue about this (link back to this thread). For now, though, there are three possible workarounds: 1. Because the URL args are preserved, you can put the step in a URL arg instead of a "step" variable in the query string. 2. You can store the step in the session rather than in the URL (not good for bookmarking). 3. You can manipulate the widget after it has been instantiated (haven't tried it, but I think it should work): city_widget = SQLFORM.widgets.autocomplete(request, db.city.name, id_field=db.city.id) city_widget.url = URL(args=request.args, vars=request.get_vars) db.person.city.widget = city_widget Also, note that there is an error in your code -- you are assigning the widget to db.person.city rather than to db.person.city.widget. Anthony On Saturday, September 19, 2015 at 11:05:52 AM UTC-4, Yoel Benitez Fonseca wrote: > > hi! i have been struggling with a annoying bug, i got a this in a > controller: > > --- > def some_function(): > if not request.vars.step: > redirect(URL('some_function', vars=dict(step=1))) > # > # a lot of stuff in the middle > # > if request.vars.step = '3': > db.person.city = SQLFORM.widgets.autocomplete(request, > db.city.name, id_field=db.city.id) > form = SQLFORM.factory(db.person): > if form.process().accepted: > # do some stuff > pass > # more stuff... > --- > > The problem is that the autocomplete callback overwrite anything in > request.vars and only left his own parameter _autocomplete_city_name, > is this the intended behavior ? i mean for me it have more sense that > the autocomplete callback add what it need and leave the others things > in place. > > -- > Msc. Yoel Benítez Fonseca > Especialista en TI > http://redevil.cubava.cu/ > Tel.: (53 32)284701 > -- 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: mail send
Hi, Le 18/09/2015 23:20, 黄祥 a écrit : > hm, not sure, i get it, but i guess that you can use the query for > that and pass it into mai.send(to=query result, ...). Yes it's what I thought. > another thing is, it seems i can't find mail.settings.to in web2py > book. pls read the book about setup and sending emails > e.g. from book It's why I said it doesn't work : mail.settings.to = db.auth_user.email_address (which is my field) which does not work as mail.settings has no to attribute. Thank you, kind regards, -- “One original thought is worth a thousand mindless quotings.” “Le vrai n'est pas plus sûr que le probable.” Diogene Laerce -- 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. signature.asc Description: OpenPGP digital signature
Re: [web2py] Re: SQLform grid custom function for delete
Hello So I managed to put link and create it but now I have a probelm getting the id of the record I want to deal with links = [lambda row: A('',_class='glyphicon glyphicon glyphicon-remove-sign', callback=URL('settings','deactivate',vars=dict(table='skills',field = 'sk_status', value = form.vars.id )))] how do i get sqlform grid record to send it to my function??? Anthony this is my function I have to change field status in a table. We have more than one status (active, pending, deleted archived) so I couldnt use the web2py default funciton as true or false since we name our filed status based on table i have to send table name and table field that is why this kind of function because i use it in different tables @auth.requires_login() def deactivate(): ##Aktiviramo delavca ko user klikne na activate user = auth.user_id org = db(db.auth_user.id == user).select(db.auth_user.organization)[0]["organization"] #Worker je id zaposlenenga ki ga damo v aktiven id = request.vars["id"] table = request.vars["table"] field = request.vars["field"] print request print id query = db(db[table].id == id).update(**{field: 1}) return locals() Thank you 2015-09-18 18:41 GMT+08:00 Anthony: > Yes, but what problem do you observe? Are the URLs not getting generated > properly? Is the value not available in request.get_vars? What happens when > you click? Can you show the code of the action associated with that URL? > > -- > 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/3T1Qaf39wJg/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. > -- Lep pozdrav Vid Ogris -- 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: SQLform grid custom function for delete
On Saturday, September 19, 2015 at 4:18:49 AM UTC-4, Yebach wrote: > > Hello > > So I managed to put link and create it but now I have a probelm getting > the id of the record I want to deal with > > links = [lambda row: A('',_class='glyphicon glyphicon > glyphicon-remove-sign', > callback=URL('settings','deactivate',vars=dict(table='skills',field = > 'sk_status', value = form.vars.id )))] > If you want the id of the record in a given row of the table, then instead of value=form.vars.id, it should be value=row.id. > @auth.requires_login() def deactivate(): ##Aktiviramo delavca ko user > klikne na activate user = auth.user_id org = db(db.auth_user.id == > user).select(db.auth_user.organization)[0]["organization"] #Worker je id > zaposlenenga ki ga damo v aktiven id = request.vars["id"] > In the URLs generated in the grid, you used the variable name "value", yet here you are looking for the variable name "id". The above line should be: id = request.vars.value Or you can change the URLs to use "id" as the variable name. 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.
[web2py] Autocomplete widget don't respect other values in request.vars
hi! i have been struggling with a annoying bug, i got a this in a controller: --- def some_function(): if not request.vars.step: redirect(URL('some_function', vars=dict(step=1))) # # a lot of stuff in the middle # if request.vars.step = '3': db.person.city = SQLFORM.widgets.autocomplete(request, db.city.name, id_field=db.city.id) form = SQLFORM.factory(db.person): if form.process().accepted: # do some stuff pass # more stuff... --- The problem is that the autocomplete callback overwrite anything in request.vars and only left his own parameter _autocomplete_city_name, is this the intended behavior ? i mean for me it have more sense that the autocomplete callback add what it need and leave the others things in place. -- Msc. Yoel Benítez Fonseca Especialista en TI http://redevil.cubava.cu/ Tel.: (53 32)284701 -- 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.