[web2py] Display SQLFORM.Grid inside view of another SQLFORM.grid.

2015-07-07 Thread Prasad Muley
Hi, I have a SQLFORM.grid which displays information about employee table. Every employee may have multiple addresses. So I have to display multiple address in another grid (address grid) inside edit form of the employee grid. *models/db.py* db.define_table('employee',

[web2py] Re: questions about autocomplete widget

2015-07-07 Thread 黄祥
it seems autocomplete have a logic from first word that store in the field table e.g. db.sale_order.customer.widget = SQLFORM.widgets.autocomplete( request, db,customer.address, id_field = db.customer.id, limitby = (0, 10), min_length

[web2py] Re: Display SQLFORM.Grid inside view of another SQLFORM.grid.

2015-07-07 Thread 黄祥
had you try to give a name for each SQLFORM.grid(formname = 'form1') and SQLFORM.grid(formname = 'form2') best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/lis

[web2py] Re: Display SQLFORM.Grid inside view of another SQLFORM.grid.

2015-07-07 Thread Prasad Muley
Hi stifan, I've tried to give a different name for each SQLFORM.grid But it didn't work. On Tuesday, July 7, 2015 at 5:56:18 PM UTC+5:30, 黄祥 wrote: > > had you try to give a name for each SQLFORM.grid(formname = 'form1') and > SQLFORM.grid(formname = 'form2') > > best regards, > stifan >

[web2py] DAL min on 2 date columns

2015-07-07 Thread lyn2py
Hi, If I have 2 columns, date_created, date_updated db.define_table('table', Field('date_created', 'datetime',default=request.now), Field('date_updated', 'datetime',update=request.now), ) and I want to do a DAL query to get the datetime that is the furthest from now (i.e. the db entry

Re: [web2py] Display SQLFORM.Grid inside view of another SQLFORM.grid.

2015-07-07 Thread Massimiliano
Hi, take a look to the manual: http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid Multiple grids per controller function Because of the way grid works one can only have one grid per controller function, unless they are embedded as components via LOAD. To make the

[web2py] Re: Display SQLFORM.Grid inside view of another SQLFORM.grid.

2015-07-07 Thread Anthony
The problem is that both grids then need to share the URL args. You can probably manage that by using the "args" argument to tell the second grid to ignore the first few URL args (which are used by the first grid), but life might be easier if you just put the second grid inside an Ajax componen

[web2py] Re: Display SQLFORM.Grid inside view of another SQLFORM.grid.

2015-07-07 Thread Anthony
Also, you cannot call form.process() on a grid form, as the initial call to .grid() already does the processing (so you are attempting to process it a second time, which will fail). On Tuesday, July 7, 2015 at 10:07:44 AM UTC-4, Anthony wrote: > > The problem is that both grids then need to shar

[web2py] Re: DAL min on 2 date columns

2015-07-07 Thread pjryan126
Why not make it Field('date_updated', 'datetime', default=request.now, update=request.now) and then search on date_updated only? On Tuesday, July 7, 2015 at 9:04:21 AM UTC-4, lyn2py wrote: > > Hi, > > If I have 2 columns, date_created, date_updated > > db.define_table('table', > Field('date_

[web2py] JSON and url vars

2015-07-07 Thread Carla Raquel
I'm passing a few variables from the controller(including one of them a list) to the view and I have a link that is built using those variables.Below is the controller function: def indexResumo(): meses = {'Janeiro':1,'Fevereiro':2,'Março':3,'Abril':4,'Maio':5,'Junho':6,'Julho':7,'Agosto':8

[web2py] Re: How to insert data in data base by xml file

2015-07-07 Thread Carla Raquel
This is how I dealt with my xml files: doc = xml.dom.minidom.parse("...my_xml.xml")// Here you parse the xml file for node in doc.getElementsByTagName("recipe")://Here you read in a cycle the tags which contain numerous attributes each t=node.getAttribute("name")//Each attribute is st

[web2py] Web2py application running very slow on rocket server in production mode

2015-07-07 Thread Ramashish Gaurav
Hello all, I deployed a web2py application on a local intranet Windows 2012 server with 8 GB of RAM, 8 Core processor. I am running the application on Rocket Server. Now the application runs very slow in production mode. I compiled the app, and the speed improved, but still it is very slow. H

[web2py] Re: Web2py application running very slow on rocket server in production mode

2015-07-07 Thread Leonel Câmara
Well rocket is slow. Use IIS and fastcgi. -- 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 Goog

[web2py] Re: Web2py application running very slow on rocket server in production mode

2015-07-07 Thread Ramashish Gaurav
Hello Leonel! Thanks for your interest. Can you explain a bit more about IIS and fastcgi How to use it ? Is it an alternative to Apache or Rocket or is it just for running testing phase of the app? On Tuesday, July 7, 2015 at 10:41:46 PM UTC+5:30, Leonel Câmara wrote: > > Well rocket is s

Re: [web2py] Re: Web2py application running very slow on rocket server in production mode

2015-07-07 Thread Richard Vézina
Rocket is for development... Apache, Nginx IIS (microsoft web server), etc. are production web servers... You may have a look in web2py scripts folder there is basic "stage/production" facilitating script that may help you set up you "production" environment... Let says at start more a "stage" env

[web2py] Re: DAL min on 2 date columns

2015-07-07 Thread Dave S
On Tuesday, July 7, 2015 at 8:15:08 AM UTC-7, pjryan126 wrote: > > Why not make it Field('date_updated', 'datetime', default=request.now, > update=request.now) and then search on date_updated only? > Jumping in, let me say that I like this. For rows that haven't been updated since they were c

Re: [web2py] Re: format field from m:1 table

2015-07-07 Thread Richard Vézina
For the requires part, see Anthony answer here : https://groups.google.com/d/msg/web2py/QBTYaytNypU/DW2HpnT-xK0J Representation is easier : represent lambda id, row: '{0} {1} {2}'.format(row.produc_name, db.company(id).name, db.region(db.company(id).id).name) if id else T('N/A') I am not sure Ste

[web2py] Re: DAL min on 2 date columns

2015-07-07 Thread 黄祥
not sure i fully understand what you want to achieve, but i guess you can use logical operator for that and combine it with DAL min. ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Logical-operators best regards, stifan -- Resources: - http://web2py.com - http:

Re: [web2py] Re: Semantic 2.0

2015-07-07 Thread eric cuver
oh my god semantic i'm fan Le lundi 6 juillet 2015 18:12:28 UTC+2, JorgeH a écrit : > > I am open to use both. > > On Monday, July 6, 2015 at 10:21:55 AM UTC-5, Massimo Di Pierro wrote: >> >> I am the one who proposed moving to semantic a year ago but the >> overwhelming majority here wanted boo

Re: [web2py] Re: prettydate ago is not translated

2015-07-07 Thread icodk
Thanks for your help. My editor (web2py web interface, Notepad++,Visual Studio) should be able to find 'ago' in any sentence combination. It also found '%d weeks ago' as I wrote below so I can't see any reason why it should not find "%d hours ago" unless it is not there. May be I am looking in

[web2py] Where to call python code for processing (embedded as JS or in controllers)?

2015-07-07 Thread Phillip
I am having trouble finding anything definitive here. Please help if you have any input, even if short. My goal is to prevent the server from doing the python processing. Is this incorrect?: If running the python in the controller function (instead of embedding as JS), the server will do

[web2py] Re: Invalid literal for init with base 64

2015-07-07 Thread Alessio Varalta
Hi, thank for your reply this is my table and the filed date are the problem db.define_table('esercizio', Field ('partenza',type='date',requires=IS_NOT_EMPTY ()),

[web2py] Is the server or client processing Python in the controller?

2015-07-07 Thread Phillip
I assume python embedded into a view would be processed by the server. This would be useful to know to given the difficulty to say what CPU costs may be. If all is by default processed by the server, would delegating this processing to the client be viable? Any ideas appreciated -- Resour

Re: [web2py] Re: Prevent multiple submit buttons from showing "Working..." on submit

2015-07-07 Thread Krzysztof Socha
On Wednesday, December 11, 2013 at 10:01:39 PM UTC+1, Mark Li wrote: > > I looked into the code and my web2py.js was not the same as the github > link, which I noticed because my forminputclickselector did not contain > > :not([name]) > > . When I diff-ed the original link for the newest web2py

[web2py] allow multiple extensions on upload

2015-07-07 Thread reddyreddy
Hello, I want to allow upload field to be as .c or .java or .py. I have seen the book that there is a way for uploading images with different extensions. Can anyone please let me know how to do it for files. Thanks in advance. -- Resources: - http://web2py.com - http://web2py.com/book (Documen

Re: [web2py] Re: sending email

2015-07-07 Thread Chaitu P
Thank you so much, that got worked. On Sun, Jul 5, 2015 at 4:47 PM, Jose C wrote: > Hmm...are you running your code on a webfaction server or on another > machine? > > If not running on a webfaction server you'll need to connect to port 587 > like so: > mail.settings.server = 'smtp.webfaction.co

[web2py] Re: Scheduling and/or multiprocessing

2015-07-07 Thread Phillip
I may be testing soon now that I have enough incentive to try it (first need to implement/test in python scripts and verify the best way to store custom Python objects for my purpose). On Monday, July 6, 2015 at 10:26:15 AM UTC-5, Massimo Di Pierro wrote: > > It should be fine as long as the pro

[web2py] Re: google play

2015-07-07 Thread eric cuver
Bruno cezar rocha on twitter answer me: 1. *eric* ‏@ghyfr1 12 hil y a 12 heures @rochacbruno hi bruno you can show me or explain how i can create web2py appl

[web2py] ascii codec can't decode byte

2015-07-07 Thread icodk
I have a small web2py site that works fine when runs on a Windows 7 machine. I move it to a linux machine,and everything worked fine until I try to save some text to a pg database that includes letters like: æØÅ I can insert that type of letters in the database (using pgAdmin3 or commandline )

[web2py] get fullpath of uploaded files

2015-07-07 Thread reddyreddy
Hello all, I want to get the full path of the files that were uploaded. Iam giving the uploaded folder as 'static/temp' in db.py. Thankyou in advance. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.go

[web2py] Re: list:integer X list:reference for auth_user table

2015-07-07 Thread kulin shah
Hi, I am a newbie to web2py and programming in general. I have something like this: Field('cc_list','list:integer',requires=IS_EMPTY_OR(IS_IN_DB(db,'auth_user.id',db.auth_user._format,multiple=True))), but this is giving an error: Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16.

[web2py] Re: Invalid literal for init with base 64

2015-07-07 Thread Dave S
On Tuesday, July 7, 2015 at 2:40:55 PM UTC-7, Alessio Varalta wrote: > > Hi, thank for your reply this is my table and the filed date are the problem > > db.define_table('esercizio', > Field > ('partenza',type='date',requires=IS_N

[web2py] Re: allow multiple extensions on upload

2015-07-07 Thread Leonardo Pires Felix
The validator IS_UPLOAD_FILENAME does what you want. Just add the regex that check if the extension is the one you want. requires = IS_UPLOAD_FILENAME(filename='^README$', extension='^(py|java|c)$', case=0) Em terça-feira, 7 de julho de 2015 18:40:55 UTC-3, reddyreddy escreveu: > > Hello, > >

[web2py] Re: ascii codec can't decode byte

2015-07-07 Thread Leonardo Pires Felix
Use psycopg2 as database driver, just install it and restart your application. pg8000 has a problem with coding. Em terça-feira, 7 de julho de 2015 18:40:55 UTC-3, icodk escreveu: > > I have a small web2py site that works fine when runs on a Windows 7 > machine. > I move it to a linux machine,a

[web2py] Re: Is the server or client processing Python in the controller?

2015-07-07 Thread Michael Beller
The book has a good overview how a web application works: http://www.web2py.com/books/default/chapter/29/01/introduction#Model-View-Controller A browser only processes HTML, CSS, and Javascript. The w2p controller processes a view and generates the html, css, and javascript required to send to t

[web2py] Re: Where to call python code for processing (embedded as JS or in controllers)?

2015-07-07 Thread Michael Beller
Why do you want to prevent the server from doing the python processing? I don't know what you mean by "instead of embedding as JS" On Tuesday, July 7, 2015 at 5:40:39 PM UTC-4, Phillip wrote: > > I am having trouble finding anything definitive here. Please help if you > have any input, even if s

[web2py] Re: JSON and url vars

2015-07-07 Thread Leonardo Pires Felix
This is not a recomended approach. Sending such variables on URL you may run out of space, see here . And those variables will be cached on user browser, giving space for security breaches. And exposing those variables to the user you may run with some un

[web2py] Re: get fullpath of uploaded files

2015-07-07 Thread Anthony
os.path.join(request.folder, 'static', 'temp', filename) On Tuesday, July 7, 2015 at 5:40:39 PM UTC-4, reddyreddy wrote: > > Hello all, > > I want to get the full path of the files that were uploaded. > Iam giving the uploaded folder as 'static/temp' in db.py. > > Thankyou in advance. > > > > >

[web2py] Re: Where to call python code for processing (embedded as JS or in controllers)?

2015-07-07 Thread Anthony
Any Python in your app, whether in a controller or view, will be executed on the server, as the browser cannot execute Python. If you want things to happen dynamically on the page in the browser without loading a new page, then you can use Javascript or make Ajax calls to get new HTML content fr

Re: [web2py] Re: Web2py application running very slow on rocket server in production mode

2015-07-07 Thread Ramashish Gaurav
Hello Richard, I appreciate your interest in my issue. I tried looking into the script folder of web2py, however did not find any "stage/production" file or script. Can you please explain in detail what you are trying to say. On Wednesday, July 8, 2015 at 12:37:16 AM UTC+5:30, Richard wrote: >

[web2py] @cache lose response

2015-07-07 Thread Dmitry Ermolaev
if @cache.action(time_expire=exp_time, cache_model=cache.disk, vars=False, public=False, lang=True) def contacts(): response.title=T('Контакты') response.not_show_func = True h = CAT( H3(T('Отзывы, Обсуждение, Жалобы, Благодарности')), T('Можно найти в ветке на'),' ',

[web2py] Re: @cache lose response

2015-07-07 Thread Dmitry Ermolaev
if cache_model not et - all work good среда, 8 июля 2015 г., 8:59:19 UTC+3 пользователь Dmitry Ermolaev написал: > > if > @cache.action(time_expire=exp_time, cache_model=cache.disk, vars=False, > public=False, lang=True) > def contacts(): > response.title=T('Контакты') > response.not_show

[web2py] Re: @cache lose response

2015-07-07 Thread Dmitry Ermolaev
exp_time = request.is_local and 3 or 360 @cache(request.env.path_info, time_expire=exp_time) not work properly - 1st call if good but all other calls is bad with response.any_my_vars is null -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/we

[web2py] Re: format field from m:1 table

2015-07-07 Thread Mirek Zvolský
I am busy now and will make experiments later. And write the results here. About format/represent from the book (if I understand this properly): Format is default value for represent assigned to foreign keys which link such table -- Resources: - http://web2py.com - http://web2py.com/book (Docum