[web2py] Re: Postgres migration errors

2018-09-17 Thread Rahul
Hi Everyone, I am glad to say that my application (http://www.targetsoft.co.in/ ) is up and running on personal VPS. I've added links to total of three applications all written in web2py 1. HMS (Hospital Management system ) coded back in 2016 - may have a few issues 2. Target+ (Tic

Re: [web2py] Re: Form submit takes too long

2018-09-17 Thread Maurice Waka
Noted. I removed some while loops with tremendous results. It now works well. Regards. On Sep 18, 2018 7:02 AM, "Massimo Di Pierro" wrote: > I understand the confusion. In SQLAlchemy for example people use .first() > for fetch one record. In web2py the feching is by the select. .first() just > g

[web2py] Re: conditional requirements

2018-09-17 Thread Massimo Di Pierro
The problem is that you have to populate the next field with ajax based on the valued of the previous files. This is async and you need to decide how to handle errors, waiting, edits, etc. You are better off doing your own form with vue js. On Sunday, 16 September 2018 11:01:15 UTC-7, Diego Tos

[web2py] Re: Form string display mask

2018-09-17 Thread Massimo Di Pierro
https://igorescobar.github.io/jQuery-Mask-Plugin/docs.html On Friday, 14 September 2018 06:05:22 UTC-7, Yann Dulondel wrote: > > Hello, > My user have to enter container number. > The container number is a string of lenght 11 char > The data for example is FCIU5808141 that must be display as FCIU

[web2py] Re: orderby and NULLS last

2018-09-17 Thread Massimo Di Pierro
db().select(orderby="sort_expression1 ASC NULLS LAST") orderby can be a string in SQL. # from gluon.dal import Expression was a cut and paste error On Monday, 17 September 2018 21:40:53 UTC-7, Massimo Di Pierro wrote: > > from gluon.dal import Expression > > db().select(orderby="sort_e

[web2py] Re: orderby and NULLS last

2018-09-17 Thread Massimo Di Pierro
from gluon.dal import Expression db().select(orderby="sort_expression1 ASC NULLS LAST") orderby can be a string in SQL. On Monday, 10 September 2018 01:10:08 UTC-7, Mike Constabel wrote: > > Hello, > > is it possible to sort NULLS last with orderby desc? > > orderby=~db.table.last_login

[web2py] Re: Prevent 1st row from deleting

2018-09-17 Thread Massimo Di Pierro
how about this? db.define_table('thing', Field('name'), auth.signature) user_to_delete = 5 first_thing = db(db.thing.created_by==user_to_delete).select(db.thing.id, limitby=(0,1)).first() db(db.thing.created_by==user_to_delete)(db.thing.id!=first_thing.id).delete() On Sunday, 9 September 2018 1

[web2py] Re: Stats from Jetbrains

2018-09-17 Thread Massimo Di Pierro
Very interesting stats. 6%. Not bad at all. On Tuesday, 4 September 2018 21:07:59 UTC-7, Carlos Cesar Caballero wrote: > > Hi, there are some interesting stats published by Jetbrains > https://www.jetbrains.com/research/devecosystem-2018/python/ > > > Greetings. > > > -- Resources: - http://w

[web2py] Re: import integer (E+12) from csv

2018-09-17 Thread Massimo Di Pierro
Unless you specify Field(, requires=IS_INT_IN_RANGE(-1e100,1e100)) it defaults to IS_INT_IN_RANGE(-1e12, +1e12). Yes it is an odd choice. On Monday, 3 September 2018 07:53:29 UTC-7, broneksmig...@gmail.com wrote: > > Hello, > > I am using the database administration tool to import a small p

[web2py] Re: Smartgrid links with many-to-many join tables

2018-09-17 Thread Massimo Di Pierro
It is not that it does not work. it just treats a link table as a normal table, instead it should hide it and only use it to build the queries. it is not a hard change to make but we never got to make it because we always plant to reimplement the grid in a more modular manner On Monday, 3 Septe

[web2py] Re: Help with CAS logout

2018-09-17 Thread Massimo Di Pierro
I think what you want should be an option of CAS (not implemented). You can implement it yourself with, for example: import requests auth.settings.logout_onlogout = lambda user: raise HTTP(auth.settings.cas_provider+'/logout') On Sunday, 2 September 2018 21:46:31 UTC-7, fiubarc wrote: > > Hello

[web2py] Re: Form submit takes too long

2018-09-17 Thread Massimo Di Pierro
I understand the confusion. In SQLAlchemy for example people use .first() for fetch one record. In web2py the feching is by the select. .first() just gives you the fist of the records that were retrieved. On Sunday, 2 September 2018 18:52:35 UTC-7, Anthony wrote: > > - my first attempt will be t

[web2py] Re: Web2py website list

2018-09-17 Thread Massimo Di Pierro
Thanks for letting us know. :-) We have not done a good job at maintaining that list and we should clean it up. Anyway, you should be able to submit the site yourself. Let us know if it doe not work and we will fix it. http://web2py.com/poweredby On Sunday, 2 September 2018 14:28:08 UTC-7, Gual

[web2py] Re: MySQL, self-reference, and null values

2018-09-17 Thread fkn sec
Noticed when doing the migration, you have to both add the group and manually add the user in the database table. That solved my issue. On Friday, February 1, 2013 at 10:20:54 AM UTC-5, Loïc wrote: > > Dear All, > > I have a 'page' model with a sef-reference: > db.define_table('page', > Fie

[web2py] web2py auth through AWS cognito

2018-09-17 Thread kryton4567
I am changing the login authentication to be handled by AWS Cognito and require some clarification around the approach as cannot get it to work correctly 1. I have created a class cog_login that has been assigned to the auth.settings.login_methods = [cog_login] 1. One of the fu

Re: [web2py] Autocomplete widget match middle of word

2018-09-17 Thread Al Ex
SQLFORM.widgets.autocomplete has the parameter: at_beginning that you can set to False https://web2py.readthedocs.io/en/latest/_modules/gluon/sqlhtml.html#AutocompleteWidget widget = SQLFORM.widgets.autocomplete(request, ..., at_beginning=False, ) On September 15, 2018 at 10:15:25 PM, An

[web2py] Using DAL / existing Databases

2018-09-17 Thread Ben Duncan
Ok, sorry if this may seem like a long post to some. I have created a framework of sorts to generate tables for an accounting system. They tables themselves are generate from various Python programs that read layouts from old COBOL programs/ AppGen 4gl / Informix schemas , Oracle schemas ,Tryton

Re: [web2py] Re: default search string in SQL.grid

2018-09-17 Thread 'Matthew J Watts' via web2py-users
thanks that worked a treat! So was that done using jquery? I still have to learn about it On Thu, Sep 13, 2018 at 5:39 PM Anthony wrote: > On Thursday, September 13, 2018 at 8:36:11 AM UTC-4, Marcelo Huerta wrote: >> >> El jueves, 13 de septiembre de 2018, 8:10:48 (UTC-3), Matthew J Watts >> esc

[web2py] Re: Setting filename to a streamed file

2018-09-17 Thread Simona Chovancová
Thanks, worked On Thursday, September 13, 2018 at 5:18:25 PM UTC+2, tim.n...@conted.ox.ac.uk wrote: > > Are you setting the PDF's title before streaming it? > > pdf.set_title('Whatever you want to appear in the tab') > pdf_stream = pdf.output(dest='S') > > > > On Thursday, 6 September 2018 13:16

Re: [web2py] Re: Python loop brings an error

2018-09-17 Thread Lovedie JC
When I restart the app rhea,error disappears briefly then recurs. On Sep 12, 2018 1:30 AM, "Leonel Câmara" wrote: > I haven't tried it, but are you using global variables inside your > controller file? You could easily be always using the same results list > which you are always appending to. >

[web2py] Re: Create a drop-down menu from a database

2018-09-17 Thread Diego Tostes
Massimo, may i use multiple fields on SQLFORM.factory? may be a solution to create a form with the functionality of set a state and automatically fill a dropdown with all cities from selected state, set a city and automatically fill a dropdown with all zones from that selected cities...

[web2py] Re: Autocomplete widget match middle of word

2018-09-17 Thread 'Annet' via web2py-users
Hi Anders, In the query use .contains() Something lijke: rows = db(db.table.field.contains(request.get_vars.term, case_sensitive=False)).select().as_list() Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)