[web2py] orderby and NULLS last

2018-09-10 Thread Mike Constabel
Hello, is it possible to sort NULLS last with orderby desc? orderby=~db.table.last_login I want the empty last_login last in desc sorting. On postgresql: ORDER BY sort_expression1 [ASC | DESC] [NULLS { FIRST | LAST }] Thanks, Mike -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Howto override login_bare?

2016-11-24 Thread Mike Constabel
Am Donnerstag, 24. November 2016 14:07:07 UTC+1 schrieb Leonel Câmara: > > You can actually use login_user which just takes a user Row and makes it > be the logged in user, which is what login_bare and the other login methods > use after verifying the password. I think this is a bad idea even

[web2py] Re: Howto override login_bare?

2016-11-24 Thread Mike Constabel
Strictly speaking I want the original login_bare plus an login_bare_without_password, which allows login only with username. This is only for intranet use. Mike -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Howto override login_bare?

2016-11-24 Thread Mike Constabel
Hello, for an intranet page with special login I need an additional "login_bare", firstly without password. To test ist, I try in model: from gluon.tools import Auth class MC_Auth(Auth): def mc_login_bare(self, username, password): """ logins user """

[web2py] Re: readonly field only in SQLFORgrid edit page if field is not empty

2016-05-28 Thread Mike Constabel
Am Freitag, 27. Mai 2016 06:48:31 UTC+2 schrieb Anthony: > > def list_order_type(): > if 'edit' in request.args: > record = db.foobar(request.args(-1, cast=int)) > older_than_an_hour = record.created_on < request.now - datetime. > timedelta(hours=1) >

[web2py] readonly field only in SQLFORgrid edit page if field is not empty

2016-05-26 Thread Mike Constabel
Hello, I try to find a solutiuon for a hopefully simple problem. Example: db.define_table("foobar", Field("uuid", "string"), Field("text", "string"), Field('created_on', "datetime", default=request.now)) def list_order_type(): form = SQLFORM.grid(db.foobar) return

[web2py] Re: Upload file using the LOAD (....., ajax = True)

2016-03-27 Thread Mike Constabel
Hello Massimo, Am Sonntag, 27. März 2016 17:18:42 UTC+2 schrieb Massimo Di Pierro: > > Hello Mike, > > could you explain your patch to web2py-developers? it is quite extensive. > > I think you misunderstood me (or I didn't explain it well). This "patch" is only a summary of what I found in

[web2py] Re: Upload file using the LOAD (....., ajax = True)

2016-03-26 Thread Mike Constabel
Hello all and Anthony, Am Freitag, 20. November 2015 07:52:05 UTC+1 schrieb Bart: > > Hi Anthony, > > This solution you mention is, with some minor changes, still working in > the current version. I've managed to get the change working in the 2.12.3 > version of web2py.js: > Change function

[web2py] Re: Additional field type for real boolean

2016-01-18 Thread Mike Constabel
Am Montag, 18. Januar 2016 18:06:32 UTC+1 schrieb Anthony: > > Maybe this will work: > http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Custom-Field-types--experimental- > This looks good. Don't know why I didn't see this before... This seems to work: from

[web2py] Additional field type for real boolean

2016-01-18 Thread Mike Constabel
Hello, I need to map *a new* boolean field in a real postgresql bolean field. In an old post from 2012 I found this: > I understand the problem. You can chance the DB type (and you did) but > web2py still tries to put an 'F' or a 'T' in there. > > I modified trunk so that this can be

[web2py] howto: ajax call in FORM with signed URL

2014-03-19 Thread Mike Constabel
Hi, in a form i have TD(INPUT(_id='keyword', _name='keyword', _onkeyup=ajax(URL('callback', ['keyword', 'stype']), 'target');), _name=search_type))) If a text is entered, callback is called an some text is displayed in target. This works. But now I want to sign the URL. If I add

[web2py] Re: howto: ajax call in FORM with signed URL

2014-03-19 Thread Mike Constabel
', _name='keyword', _onkeyup=ajax(URL('callback', ['keyword', 'stype'], user_signature=True), 'target');), _name= search_type))) Regards On Wednesday, March 19, 2014 1:59:38 PM UTC+1, Mike Constabel wrote: Hi, in a form i have TD(INPUT(_id='keyword', _name='keyword', _onkeyup=ajax(URL

[web2py] Re: howto: ajax call in FORM with signed URL

2014-03-19 Thread Mike Constabel
/04/the-core?search=signed#Digitally-signed-urls BTW: auth.requires_signature() takes hash_vars as a parameter too. On Wednesday, March 19, 2014 10:18:38 PM UTC+1, Mike Constabel wrote: Doesn't work. The generated HTML code: input id=keyword name=keyword onkeyup=ajax(URL(#x27;callback#x27

[web2py] Multiple SOLIDFORMs from table rows

2014-02-10 Thread Mike Constabel
Hi, I try to generate multiple SOLIDFORMS from table rows. Simple example in pseudo code: x = db(y.z).select() for d in x: form=CAT(form, SOLIDFORM(d)) return dict(form=form) This works for me: Model: #simplified, the tables are much longer in real db.define_table(foo_analysis_type,

Re: [web2py] Multiple SOLIDFORMs from table rows

2014-02-10 Thread Mike Constabel
Hi, Am Montag, 10. Februar 2014 16:05:49 UTC+1 schrieb viniciusban: Maybe I missed something, but what is a SOLIDFORM? Sorry, forget to mention it. SOLIDFORM is an extended SQLFORM http://dev.s-cubism.com/plugin_solidform -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Multiple SOLIDFORMs from table rows

2014-02-10 Thread Mike Constabel
Am Montag, 10. Februar 2014 16:21:57 UTC+1 schrieb Cliff Kachinske: Have you tried it without the showid arg? Yes, same error. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Multiple SOLIDFORMs from table rows

2014-02-10 Thread Mike Constabel
Yes. same error. Am Montag, 10. Februar 2014 16:21:57 UTC+1 schrieb Cliff Kachinske: Have you tried it without the showid arg? On Monday, February 10, 2014 3:12:36 AM UTC-5, Mike Constabel wrote: Hi, I try to generate multiple SOLIDFORMS from table rows. Simple example in pseudo code