Re: [web2py] orderby=['alias'] - works in sqlite, but not in postgres

2019-06-17 Thread Eliezer (Vlad) Tseytkin
Thank you! On Tue, Jun 18, 2019, 1:19 AM Val K wrote: > Try [~db.cart_sharing.stats.sum()] > > -- > 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) >

[web2py] orderby=['alias'] - works in sqlite, but not in postgres

2019-06-17 Thread Val K
Try [~db.cart_sharing.stats.sum()] -- 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

[web2py] orderby=['alias'] - works in sqlite, but not in postgres

2019-06-17 Thread Vlad
This works perfect in SQLite: rows = db(query).select(db.cart_sharing.created_by.with_alias('sharer'), db.cart_sharing.stats.count().with_alias('carts' ), db.cart_sharing.stats.sum().with_alias('shares'),

Re: [web2py] Re: web2py dynamic queries

2019-06-17 Thread Jim Steil
I think you need to check the web2py errors that are being generated. That should tell you what is going on. Jim On Mon, Jun 17, 2019, 5:04 PM Cristina Sig wrote: > I'm having the same datatables warning: ajax error so I guess it might be > the referenced field that is causing the error

[web2py] Re: web2py dynamic queries

2019-06-17 Thread Cristina Sig
I'm having the same datatables warning: ajax error so I guess it might be the referenced field that is causing the error because even the table is not being field with data. El lunes, 17 de junio de 2019, 18:55:02 (UTC-3), Jim S escribió: > > Are you getting an error on the referenced field

[web2py] Re: web2py dynamic queries

2019-06-17 Thread Jim S
Are you getting an error on the referenced field (Nationality) or is it just not returning the results you're expecting? -Jim On Monday, June 17, 2019 at 4:46:14 PM UTC-5, Cristina Sig wrote: > > thanks! > I solved the integer field but it seems that the referenced fields are not > working. >

[web2py] Re: web2py dynamic queries

2019-06-17 Thread Cristina Sig
thanks! I solved the integer field but it seems that the referenced fields are not working. I will try to see what is the issue with them El lunes, 17 de junio de 2019, 18:05:18 (UTC-3), Jim S escribió: > > I'm guessing it's the phone number field. You can't use 'contains' on a > numeric

[web2py] Re: web2py dynamic queries

2019-06-17 Thread Jim S
I'm guessing it's the phone number field. You can't use 'contains' on a numeric field. So, try this: if search_value and search_value != '' and search_value != 0: try: int_search_value = int(search_value) queries.append((db.Student.firstname.contains(search_value)) |

[web2py] Re: web2py dynamic queries

2019-06-17 Thread Cristina Sig
Hello Jim, I tried the code and it shows me an error *DataTables warning: table id=tableStudent - Ajax error. For more information about this error, please see http://datatables.net/tn/7* I think it is not recognising the numeric field or the referenced ones El lunes, 17 de junio de 2019,

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Vlad
thank you ! On Monday, June 17, 2019 at 11:02:13 AM UTC-4, Yoel Benitez Fonseca wrote: > > Vlad, in the book: > > > http://www.web2py.com/books/default/chapter/29/04/the-core#HTTP-and-redirect > > And i can comment out +/- the code: > > def user(): > > # just a way to ensure form allways

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Yoel Benitez Fonseca
Vlad, in the book: http://www.web2py.com/books/default/chapter/29/04/the-core#HTTP-and-redirect And i can comment out +/- the code: def user(): # just a way to ensure form allways have a value form = CAT() try: # the call to auth can return a lot of things # it

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Vlad
Yoel, where could I look up how this works about the exception 303? Because I don't understand that part at all - I am not aware of exception being raised, why, and how it works in the flow - could you please point me to the direction where it's explained? On Monday, June 17, 2019 at 10:16:58

[web2py] Re: web2py dynamic queries

2019-06-17 Thread Jim S
Cristina I'd look at adding a 'left' argument on my query.select(). if search_value and search_value != '' and search_value != 0: queries.append((db.Student.firstname.contains(search_value)) | (db.Student.lastname.contains(search_value)) |

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Yoel Benitez Fonseca
no, it is not. The first time the default/user is called - in the login process for example - there not a HTTP(303) (redirect) exception, and the user get the form. The second time, in this scenery, the call to auth() will cause a redirect (HTTP exception) and the user is effectively logged into

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Vlad
but isn't such a scenario catching a user in a process of logging in or logging out, but before actual login/logout? On Monday, June 17, 2019 at 9:44:10 AM UTC-4, Yoel Benitez Fonseca wrote: > > I think you can do it in the default/user function. Having in account that > the call to auth()

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Yoel Benitez Fonseca
Got a syntax error there, sorry: El lunes, 17 de junio de 2019, 9:44:10 (UTC-4), Yoel Benitez Fonseca escribió: > > I think you can do it in the default/user function. Having in account that > the call to auth() probably raises a HTTP exceptiong in case of a success. > This example is only a

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Yoel Benitez Fonseca
I think you can do it in the default/user function. Having in account that the call to auth() probably raises a HTTP exceptiong in case of a success. This example is only a proof of concept: def user(): form = CAT() try: form = auth() except HTTP as e: if e.status ==

[web2py] intercepting login & logout events

2019-06-17 Thread Vlad
What would be the simplest way to intercept login and logout? (i.e. I'd like to perform some additional tasks when a user is logged in, and when a user is logged out.) web2py elegantly hides the functionality in default.user under form=auth() and {{=form}} and somehow I can't think of a simple

[web2py] Re: How to create wrapper / decorator functions

2019-06-17 Thread Gilad Hoshmand
This is the answer: Call /controller/wrapper_func1/arg1/arg2 def wrapper_func1(): get args... response.view = "path/to/main_page.html" return generalFunc(..args..) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] How to create wrapper / decorator functions

2019-06-17 Thread Gilad Hoshmand
Hi I'm trying to create wrapper/decorator functions like so: The view to load is the same html file every time, the args need to be different. I can pass arguments using request.args[0] etc. but it seems dirty and I prefer to separate and handle pre-processing the data (according to args) in

Re: [web2py] Generating graph with chartjs

2019-06-17 Thread Christian Varas
Sorry the delay, the second chart is a radar chart Cheers. Chris. El mar., 11 de jun. de 2019 18:25, Dave S escribió: > > > On Sunday, June 9, 2019 at 3:06:01 PM UTC-7, Christian Varas wrote: >> >> II have this site www.climbersoul.cl using AdminLTE, and I with graphics >> too. >>

Re: [web2py] Generating graph with chartjs

2019-06-17 Thread António Ramos
I guess that having vue as a default frontend we shoud try to use vue charts Em sáb, 15 de jun de 2019 às 18:53, Massimo Di Pierro < massimo.dipie...@gmail.com> escreveu: > mind highcharts is not free > > On Tuesday, 11 June 2019 09:33:37 UTC-7, Lovedie JC wrote: >> >> I'm following this

RE: [web2py] web2py dynamic queries

2019-06-17 Thread John Bannister
Hi Cristina, Can you show us your view code as well? Assuming you are trying to use datatables instead of web2py Grid or Smartgrid (which gives you ability to build dynamic queries), you will probably need to loop through all the fields in the table (server side) and build your query