[web2py] Re: default value condition base on time

2016-02-09 Thread 黄祥
thank you so much dave it work perfectly e.g. table.shift.default = 1 if request.now.hour >= 0 & request.now.hour <=8 else 2 if request.now.hour >= 8 & request.now.hour <=16 else 3 thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:

[web2py] Re: Is there anyway to disable search and export sections in SQLFORM.grid

2016-02-09 Thread Anthony
SQLFORM.grid(..., searchable=False, csv=False) Anthony On Tuesday, February 9, 2016 at 3:26:04 PM UTC-5, SanDiego wrote: > > The only way I can disable search and exports sections is through > 'display:none;' style option. Is there any settings to disable them? > -- Resources: - http://web2py.

[web2py] Re: How to set default country in dropdown list

2016-02-09 Thread Dave S
On Tuesday, February 9, 2016 at 5:10:03 PM UTC-8, Winter Kryz wrote: > > Thanks for the answers > I tried what xmarx said but it didn't work > What errors did you get? > How would I use it with IS_IN_SET? > > nationalities=['United States',"United Kingdom","France",'Germany'] db.define_ta

[web2py] Re: How to set default country in dropdown list

2016-02-09 Thread Winter Kryz
Thanks for the answers I tried what xmarx said but it didn't work How would I use it with IS_IN_SET? -- 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

[web2py] Re: Is there anyway to disable search and export sections in SQLFORM.grid

2016-02-09 Thread Jim S
Set the search_widget arg to an empty form on the SQLFORM.grid call. SQLFORM.grid(other_arguments..., search_widget=FORM()) -Jim On Tuesday, February 9, 2016 at 2:26:04 PM UTC-6, SanDiego wrote: > > The only way I can disable search and exports sections is through > 'display:none;' style opt

[web2py] Re: Smartgrid internal table ordering

2016-02-09 Thread Jim S
The orderby should be a dict with the table_name as the key. The value should be the orderby used for that specific table. -Jim On Tuesday, February 9, 2016 at 2:25:52 PM UTC-6, Vikash Sharma wrote: > > > I have a smartgrid as follows > > > *grid = SQLFORM.smartgrid(db.receipt, linked_tables=['

[web2py] Re: default value condition base on time

2016-02-09 Thread Dave S
On Tuesday, February 9, 2016 at 12:14:08 PM UTC-8, 黄祥 wrote: > > is it possible to have default value condition base on time? i tried > before but return an error > e.g. 1 > > table.shift.default = 1 if request.now.hour() >= 0 & request.now.hour() <= 8 > else 2 if request.now.hour() >= 8 & requ

[web2py] SQLFORM buttons are misaligned

2016-02-09 Thread SanDiego
When used with buttons as follows, SQL form misses the offset causing the buttons misplaced towards left (see buttons-misaligned.png file). buttons = [ TAG.button(T('Save'),_type="submit",_value="save",_class="btn btn-primary"), TAG.button(T('Cancel'),_type="button", _class="

[web2py] Is there anyway to disable search and export sections in SQLFORM.grid

2016-02-09 Thread SanDiego
The only way I can disable search and exports sections is through 'display:none;' style option. Is there any settings to disable them? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/iss

[web2py] Displalay a form in light box or pop up window in view

2016-02-09 Thread billmackalister
Hello, A new user migrating from Django to web2py and absolutely loving it. A quick question. How do I use a light box or a pop up window to display a form in my view? for example in default/index.html {{=form}} Want to show that form in a pop up window. -- Resources: - http://web2py.com

[web2py] Smartgrid internal table ordering

2016-02-09 Thread Vikash Sharma
I have a smartgrid as follows *grid = SQLFORM.smartgrid(db.receipt, linked_tables=['items'], orderby="id DESC")* Using this, *receipt *table is shown correctly as order in descending order. But internal table *items* is also getting ordered in descending order. If I do *grid = SQLFORM.s

[web2py] Re: Organize translations

2016-02-09 Thread Massimo Di Pierro
No there is not and doing so by default would slow down the app because accessing the file system is a bottle neck. Yet is definitively possible to build an app that extract the info from the dictionaries and rearranges into multiple files and back. It would be a good exercise to write such an

[web2py] default value condition base on time

2016-02-09 Thread 黄祥
is it possible to have default value condition base on time? i tried before but return an error e.g. 1 table.shift.default = 1 if request.now.hour() >= 0 & request.now.hour() <= 8 else 2 if request.now.hour() >= 8 & request.now.hour() <= 16 else 3 TypeError: 'int' object is not callable e.g. 2

[web2py] Re: Can A(cid='...') replace the "loading..." text as LOAD(content='...') does?

2016-02-09 Thread Antonio Salazar
Thanks, this is much better than directly using data-loading-text and data-complete-text On Sunday, February 7, 2016 at 3:31:33 AM UTC-6, Niphlod wrote: > > LOAD(...) has a "content" keyword just for it. > A() doesn't use "loading..." but "working...". it's customizable too, > using _disable_wit

[web2py] Re: Rows not releasing all the memory back

2016-02-09 Thread Jitun John
I believe it is caching everything to memory. Here is the code I have. But yes, not a web2py issue. def read_manager_rows(): manager_db_conn = DAL('sqlite://manager.sqlite', folder=get_current_path(), auto_import=True) global manager_rows manager_rows = manager_db_conn(manager_db_conn

[web2py] Re: Make certain fields hidden within a table. Custom form

2016-02-09 Thread Ron Chatterjee
It does except for list:string. lol. Somehow I can't seem to get that to work with that. On Tuesday, February 9, 2016 at 11:13:22 AM UTC-5, Anthony wrote: > > > On Tuesday, February 9, 2016 at 7:22:51 AM UTC-5, Ron Chatterjee wrote: >> >> Thank you Anthony. I guess the only caveat is that it can

[web2py] Re: Make certain fields hidden within a table. Custom form

2016-02-09 Thread Anthony
On Tuesday, February 9, 2016 at 7:22:51 AM UTC-5, Ron Chatterjee wrote: > > Thank you Anthony. I guess the only caveat is that it can only work with a > boolean. But its great! Solves my problem. > No, it works with any type of field. Anthony -- Resources: - http://web2py.com - http://web2py.

Re: [web2py] Re: web2py as a frontend for monitoring serial ports

2016-02-09 Thread José Luis Redrejo
2016-02-09 15:17 GMT+01:00 Oliver Holmes : > José Luis, > > now that sounds promising! So, what I'd do is put my serial port reading > procedure together with SQL inserts in an endless loop (while True) and > just let it roll. > Right, but you can use DAL, not pure sql if you put the script in th

[web2py] Organize translations

2016-02-09 Thread Carlos Cesar Caballero Díaz
Hi, I have an app with lot of translation strings, and keeping all in one file is becoming a mess dificult to maintain, is there some way to do something like: translatios/ main/ default.py es.py ... breads/ default.py es.py ... specie

[web2py] Re: How to set default country in dropdown list

2016-02-09 Thread Massimo Di Pierro
I would not make this a reference fields. I would make it a IS_IN_SET(...) field. This is because possible nationalities do not change very often and are definitively not changed by the user. On Tuesday, 9 February 2016 05:34:29 UTC-6, xmarx wrote: > > db.define_table('Person', >

Re: [web2py] Re: web2py as a frontend for monitoring serial ports

2016-02-09 Thread Oliver Holmes
José Luis, now that sounds promising! So, what I'd do is put my serial port reading procedure together with SQL inserts in an endless loop (while True) and just let it roll. Later on though, I'd like to have it all wrapped up in a service to start, whenever the Raspberry booted. I'm guessing, t

[web2py] Re: A dropdown box that filters.

2016-02-09 Thread Jim S
What does your controller look like? -Jim On Monday, February 8, 2016 at 8:35:41 PM UTC-6, superpirst wrote: > > I created a website that you could post items and I'm having a lot of > problem trying to figure out how to make a dropdown menu that can filter > those posts. What I'm trying to do

[web2py] Re: Make certain fields hidden within a table. Custom form

2016-02-09 Thread Ron Chatterjee
Thank you Anthony. I guess the only caveat is that it can only work with a boolean. But its great! Solves my problem. On Monday, February 8, 2016 at 9:46:16 PM UTC-5, Anthony wrote: > > > http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields > > On Monday, February

[web2py] Re: How to set default country in dropdown list

2016-02-09 Thread xmarx
db.define_table('Person', Field('last_name', 'string'), Field('name', 'string'), Field('telephone', 'string'), Field('email', 'string'), Field('nationality','reference Nationalities',default=1), format=

[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2016-02-09 Thread Francisco García
Hi Massimo, I work as a software consultant and developer. I work with Web2py in my projects with customers. I would like to be in the list of companies My website is : www.garciac.es I offer my consulting services in Spain. Thank you. Regards, Francisco. El domingo, 15 de febrero de 2015, 2

Re: [web2py] Re: Spreadsheet.py documentation and status

2016-02-09 Thread Massimiliano
Wow nice w2ui! Thank you for sharing! On Mon, Feb 8, 2016 at 10:50 AM, Rimantas Nedzinskas wrote: > Try this: > >> http://w2ui.com/web/demos/#!combo/combo-3 >> > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > -

[web2py] Re: Web2py-appreport

2016-02-09 Thread Anthony Smith
Hi Massimo, Thanks for you help you can download form here https://github.com/lucasdavila/web2py-appreport/wiki Thanks for looking into this On Tuesday, 9 February 2016 13:37:01 UTC+11, Massimo Di Pierro wrote: > > do not know. Can you post this plugin? I have never seen it. Perhaps > assume

Re: [web2py] learning curve?

2016-02-09 Thread Thomas Bellembois
Hi Jon, I have spent a long time studying the different Python Web frameworks to develop a small chemical products management application and I have choosen Web2py mainly because of its fast learning curve (and also the active community). The official documentation is a really good point to s

Re: [web2py] Re: web2py as a frontend for monitoring serial ports

2016-02-09 Thread José Luis Redrejo
Oliver: I use to do what you need to communicate with Arduino in different projects. I think it's better if you get rid of the scheduler: you may loose data if the serial port buffer is full while the scheduler is not working. What I use is: - write a script in an infinite loop like any usual p