[web2py] Re: login validation

2020-08-31 Thread Paco Bernal
g about > is_active in auth_user? > Why is it useful? > Thank you > > > Il giorno lunedì 31 agosto 2020 08:46:15 UTC+2, Paco Bernal ha scritto: >> >> I meant registration_key :) >> >> http://web2py.com/books/default/chapter/29/09/access-control?search=block

[web2py] Re: login validation

2020-08-30 Thread Paco Bernal
I meant registration_key :) http://web2py.com/books/default/chapter/29/09/access-control?search=blocked#Access-Control El lunes, 31 de agosto de 2020 a las 0:08:32 UTC+2, Paco Bernal escribió: > Hi > If you set at anytime key_registration='blocked' in auth_user table that &g

[web2py] Re: login validation

2020-08-30 Thread Paco Bernal
Hi If you set at anytime key_registration='blocked' in auth_user table that user will not be able to loging. That's the way I would do it Regards El domingo, 30 de agosto de 2020 a las 14:11:08 UTC+2, and...@gmail.com escribió: > Hello, maybe it's easy but I don't know exactly if it's possible

[web2py] Re: Setting a background images with jQuery

2020-02-20 Thread Paco Bernal
Think that this will work for sure, I am using something similar > $(document).ready(function(){ > $(".background2").css("background", "url('{{=URL('static', > 'images/background.jpg)}}')"); > }); > > Well, the code I use is ('body').css({'background-image':'url({{=URL('static','images/%s' %

[web2py] Setting a background images with jQuery

2020-02-20 Thread Paco Bernal
Maybe you can try with https://domain/static/images/background1.jpg in the array because you need to get the picture from the server and the URL you are using does not point to any picture in front side I think... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - ht

[web2py] Registration key

2019-11-22 Thread Paco Bernal
Hi all Today my mind is a little heavy but can't wait till tomorrow Why db((db.auth_user.registration_key=='')|(db.auth_user.registration_key==None)).count() > gives me 2 and db(db.auth_user.registration_key!='blocked').count() > gives me 1 when I use only 'blocked' to block users? Thanks

[web2py] Re: Problem passing a json object to controller

2019-11-20 Thread Paco Bernal
puesta: "noexiste"} > 1. respuesta: "noexiste" > 2. vars: {tarea: "solicitudguardar", items[json1]: "[1,2,3]"} > 3. __proto__: Object > > > > Thanks in advance, > > > El miércoles, 20 de noviembre de 2019, 16:39:22 (UTC-5)

[web2py] Re: Problem passing a json object to controller

2019-11-20 Thread Paco Bernal
Hi, Try this, write down at the begin of the controller print request.vars > you will see how the controller receives the information and then you will know if it's a js problem or a server side problem. with your code what the controller receives is '{"make":"Ford","model":"Mustang","year"

[web2py] Re: upload - can I get the path to original file

2019-10-04 Thread Paco Bernal
HI db.define_table('logos', > Field('logo', 'upload', uploadfolder='applications/%s/%s' % > (request.application, 'uploads'), uploadseparate=True, autodelete=True), > Field('thumbnail', 'upload', uploadfolder='applications/%s/%s' % > (request.application, 'uploads'), uploadseparate=True, autod

[web2py] Re: Ajax Pass ID to Controller Function

2019-09-24 Thread Paco Bernal
Hi ajax('{{=URL('Tools', 'userdelete')}}/'+iduser , [], ''); > Regards -- 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 becaus

[web2py] Re: Determinign what information get displayed based on their content

2019-09-15 Thread Paco Bernal
*Is there a way i could choose what gets displayed in the view & what doesn't get displayed from the database table based on its content using only python??* {{for p in products:}} {{if p.Quantity>0:}} {{=p.whatever}} {{pass}} {{pass}} Two ways for doing that :) -- Resources: - http://web

[web2py] Re: Determinign what information get displayed based on their content

2019-09-15 Thread Paco Bernal
* Is there a way i could choose what gets displayed in the view & what > doesn't get displayed from the database table based on its content using > only python??* > > {{for p in products:}} {{=p.whatever}} {{pass}} -- Resources: - http://web2py.com - http://web2py.com/book (Documentati

[web2py] Re: Why is my if/else statement not working

2019-09-15 Thread Paco Bernal
El viernes, 13 de septiembre de 2019, 9:31:23 (UTC+2), mostwanted escribió: > > This conditional statement should be simple & execute without any issues, > I have created a point of Sale system, in a view it shows all the items & > their available quantities, what i want is that when a product'

[web2py] Re: Automatic user logout & redirect

2019-08-19 Thread Paco Bernal
redirect(URL('index'), client_side=True) -- 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 Googl

[web2py] Re: Pass variable from JavaScript function to controller: Using JSQueryBuilder

2019-08-01 Thread Paco Bernal
Hi ajax('{{=URL('default', 'showfilters')}}' + '?result1=' + result1 + '&result2='+result2, [], ':eval'); result1 = request.vars.result1 result2 = request.vars.result2 or ajax('{{=URL('default', 'showfilters')}}/' + result1 + '/' + result2, [], ':eval'); result1 = request.args(0) result2 =

[web2py] Re: Hosting question

2019-08-01 Thread Paco Bernal
Thank you, Now it's working as spected. appconfig.ini [host] > names = subdomain:* > I removed the virtualhost regarding the dedicated ips and set DocumentRoot in port 80 for my subdomain to /dev/null Not sure if it's the right way but it's working now without expliciting having a virtualhos

[web2py] Re: Hosting question

2019-08-01 Thread Paco Bernal
Yes, I discovered a few days ago that private folder can be accessed using the vps ip, so I have been playing with host names in appconfig.ini and with apache2 configuration and the only way to stop accessing private folder was adding a new virtualhost in apache for each vps ip with this: >

[web2py] Hosting question

2019-07-31 Thread Paco Bernal
Hi Please can you test this url and tell me what you have as result? http://vps_ip/applications/app1/private/appconfig.ini Change vps_ip for the ip of your server and app1 for the name of your application (folder name) Thx -- Resources: - http://web2py.com - http://web2py.com/book (Documentati

[web2py] Re: Why URL(..., scheme=True, ...) is implemented differently than request.is_https?

2019-07-25 Thread Paco Bernal
on the more sophisicated request.is_https? > > Regards, > Ray > > On Tuesday, July 16, 2019 at 2:18:45 PM UTC-7, Paco Bernal wrote: >> >> You can always redirect apache from http to https > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Anthony was right... web3py has a big naming conflict

2019-07-23 Thread Paco Bernal
And the winner is ??? -- 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 "web2

[web2py] Anthony was right... web3py has a big naming conflict

2019-07-22 Thread Paco Bernal
What about web2py3 ? -- 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-us

[web2py] Why URL(..., scheme=True, ...) is implemented differently than request.is_https?

2019-07-16 Thread Paco Bernal
You can always redirect apache from http to https -- 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

[web2py] Re: New International Telegram Support Group

2019-03-19 Thread Paco Bernal
I just joined the group. Great to be here Thx 2 all and join the group please -- 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

Re: [web2py] Re: the ajax callback action return a list [URGENT]

2017-06-01 Thread Paco Bernal
In server side when rendering the view you use python vars with {{=my_python_var}} If you are asking how to use a python var in client side with javascript you can use ASSIGNJS(js_var=python_var) Take a look at the files I uploaded before. def mycontroller(): . return ASSIGNJS(js_v

[web2py] Re: the ajax callback action return a list [URGENT]

2017-06-01 Thread Paco Bernal
But what are you returning in the controller?? El jueves, 1 de junio de 2017, 8:49:46 (UTC+2), sunda...@gmail.com escribió: > > Hey paco, > > the problem is that i am using script, so the the action in the controller > is a callback, it means that it dont have his html page. > > -- Resourc

[web2py] Re: the ajax callback action return a list [URGENT]

2017-05-30 Thread Paco Bernal
Here you have an example about what I told you without using ':eval' It's easier to user alert('{{=client_details.name}}'); of course, it's only to show you ASSIGNJS and that you always can do things in many several ways :) El martes, 30 de mayo de 2017, 14:46:08 (UTC+2), sunda...@gmail.com

[web2py] Re: the ajax callback action return a list [URGENT]

2017-05-30 Thread Paco Bernal
mmm... maybe you are looking for ASSIGNJS(js_var=python_list) It depends on the way you want to do whatever you wanna do :) if you get the name of the list is because you *return dict(your_list=your_list)* and in the view you have* {{=your_list}} *you need to *return ASSIGNJS(my_js_var=you

[web2py] Re: the ajax callback action return a list [URGENT]

2017-05-26 Thread Paco Bernal
Or you can use ':eval' as the third argument as Anthony says and return '%s%s' % (ASIGNJS(your_js_var=your_python_list), 'your_js_code_for_manipulating_the_list') This way you can manipulate your list with js in client side, but I prefer using a view if the html code is more than one or two li

[web2py] Re: the ajax callback action return a list [URGENT]

2017-05-26 Thread Paco Bernal
You have to use a view to work with the list returned by the function. Both, the view and the funcion with the same name or using response.view="view_name.html" El miércoles, 24 de mayo de 2017, 10:23:05 (UTC+2), sunda...@gmail.com escribió: > > Hello, > > > i have a form, when i fill it, it

[web2py] Re: Any more elegant way to redirect to user login when updating a div by ajax callback if not auth.user

2017-04-13 Thread Paco Bernal
ierro escribió: > > You may want to return something even if not auth.user. > > On Saturday, 1 April 2017 12:03:55 UTC-5, Paco Bernal wrote: >> >> Sorry I lost my own question for almost a year :S >> >> Finally I was doing this: >> >> def get_index(

[web2py] Re: Any more elegant way to redirect to user login when updating a div by ajax callback if not auth.user

2017-04-01 Thread Paco Bernal
th.user: > redirect(URL('default', 'user', args='login'), client_side=True) > if not auth.has_membership('role'): > raise HTTP(403, ...) > > > Anthony > > > On Saturday, June 18, 2016 at 8:47:42 AM UTC-4, Paco Ber

[web2py] Re: Any more elegant way to redirect to user login when updating a div by ajax callback if not auth.user

2017-04-01 Thread Paco Bernal
the parent window to redirect (via Javascript). So, you could do > something like: > > def get_index(): > if not auth.user: > redirect(URL('default', 'user', args='login'), client_side=True) > if not auth.has_membership('role&#x

[web2py] Any more elegant way to redirect to user login when updating a div by ajax callback if not auth.user

2016-06-18 Thread Paco Bernal
Hi all, This is my first question here, although I use it sometimes to read a few questions that I make to myself when coding using this cool and great tool. Thanks. A few months ago I started to use ajax to fill middle column of screen from clicks (interaction with the user) in the left sideb