[web2py] Re: Database insert of time field in web2py not working?

2013-11-12 Thread User
So since a time field automatically has an IS_TIME validator how would you specify additional validators after the db.define_table statement? On Tuesday, November 12, 2013 3:51:12 AM UTC-5, Niphlod wrote: > > requires can be a list of validators. > > On Tuesday, November 12, 2013 9:32:27 AM U

[web2py] rocket, windows server, bad file descriptor error due to gluon debug message

2013-11-12 Thread Tim Richardson
Rocket running as a windows service possibly doesn't like attempts to write to stderr. Traceback (most recent call last): File "d:\web2py_internet\gluon\restricted.py", line 217, in restricted exec ccode in environment File "d:/web2py_internet/applications/patient_form/models/db.py" <

[web2py] Re: mssql connection

2013-11-12 Thread Cacpacific O
Hello Tim, Thank you for sharing. I've try as your advice but it still return error message as follow, I think something wrong with my odbc setup somehow. :) db = DAL('mssql://UserName:Password@203.150.29.227\SQLExpress/myDatabase', lazy_tables=True, pool_size=10) RuntimeError: Failure to con

[web2py] SQLFORM.grid to view and using groupby clause

2013-11-12 Thread Meir
Hello, I have the following problem: I have created a view in the legacy database. In this view created a field ID of type integer and unique. I used SQLFORM.grid using fields = [...] to specify the fields that wanted and used the groupby = ... to perform clustering. But it returns an error sta

[web2py] compute and after_insert callback on table

2013-11-12 Thread 黄祥
hi, is the compute can work together with after_insert on table? i've tried before but return an error, and must do separately. e.g. *error* def __after_insert(f, id): db(db.dvd.id == f.dvd).update(quantity = db.dvd(f.dvd).quantity - f.quantity) def on_define_rent_detail(table): table._after_i

[web2py] Re: Scheduler TIMEOUT

2013-11-12 Thread Limedrop
I've had this problem too. I think it would be good if the scheduler had the option to retry timeouts, in the same way that retry_failed works. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/

[web2py] Re: CSS Fluid Layout for Window Resize

2013-11-12 Thread EW
perfect, thanks! On Tuesday, November 12, 2013 1:26:50 PM UTC-8, Niphlod wrote: > the scaffolding application (welcome) comes with bootstrap. > As a default, it uses the "default grid system". If you want to use > bootstrap's "fluid grid system" change all > > > > to > > > > > and > > >

[web2py] Re: mssql connection

2013-11-12 Thread Tim Richardson
Here is a working example using server authentication on a server called win2003, with a sqlserver instance name hcnsql07 and connecting to a database called hcn using default ports (I've added a couple of other parameters for performance. Investigate lazy_tables, it makes a huge difference. )

[web2py] Re: Scheduler TIMEOUT

2013-11-12 Thread LightOfMooN
I don't want worker without timeout. I just want scheduler task not to be stopped because of timeout from one of thousands records. Why scheduler doesn't execute tasks with status=='TIMEOUT'? I have some function like: thing = db.executesql(db(db.things.id>0)._select(..., orderby=db.things.up_

Re: [web2py] styleform text size change

2013-11-12 Thread Richard Vézina
So you have to silent bootstrap.css and put your style in your own css file, app.css for instance. You don't want to put you own css hack in base.css, because you have to update this file sometime when you upgrade web2py. To silent bootstrap you have to redefine the boostrap style that matter or ju

[web2py] Re: CSS Fluid Layout for Window Resize

2013-11-12 Thread Niphlod
the scaffolding application (welcome) comes with bootstrap. As a default, it uses the "default grid system". If you want to use bootstrap's "fluid grid system" change all to and to in views/layout.html and you'll be good to go. -- Resources: - http://web2py.com - http://web2p

Re: [web2py] styleform text size change

2013-11-12 Thread greenpoise
bootstrap.min.css if I add it there it works. On Tuesday, November 12, 2013 1:05:11 PM UTC-8, Richard wrote: > > You may have other css rules that override yours... Try to set a style > attribute to your input to see what happen, if it works it because there is > other css rules that override y

Re: [web2py] styleform text size change

2013-11-12 Thread Richard Vézina
You may have other css rules that override yours... Try to set a style attribute to your input to see what happen, if it works it because there is other css rules that override your... Try to find it, you can use Chrome dev tool, right click on the html thing and select inspect item in the menu, yo

[web2py] styleform text size change

2013-11-12 Thread greenpoise
I keep reading to do it from base.css but it is not working. My source On base.css I have #productsearch_qty {width: 3px;} -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issu

Re: [web2py] Re: web2py "Components" for layout.html and other HTML pages [ not derived from layout.html]

2013-11-12 Thread JoeCodeswell
Dear Niphlod, Thanks for the detailed response. You said: Yep, ajax is fun but having a page with 64 ... > Right, Niphlod. I am agnostic on implementing modular Component with Ajax. Please see my previous post herein which i sa

[web2py] CSS Fluid Layout for Window Resize

2013-11-12 Thread EW
I would like to have my layout (divs) resize if the user resizes the web browser. I already switched the CSS of my divs to percentages, but it's not working. It seems to me that I need to change some part of the default layout but I'm lost as to what that is (couldn't find anything that looked

Re: [web2py] Re: Web2py crash if i define model with function

2013-11-12 Thread Diogo Munaro
Hey Michele! Now it's working... The indexes are crashing web2py on apache. With a list of indexes I can execute sql in a for: for i in indices: try: db.executesql(i) except:pass Thx for all help! 2013/11/12 Diogo Munaro > It's not working... > > 1- I tried p

[web2py] Re: Scheduler TIMEOUT

2013-11-12 Thread Niphlod
with no timeout, your worker will try to fetch the site, and if your task never returns, it won't process any new task and will remain stuck. How is it better to have a worker blocked because there is no timeout ? tl;dr : you won't find any serious task processor without a timeout, because it's

Re: [web2py] Re: web2py "Components" for layout.html and other HTML pages [ not derived from layout.html]

2013-11-12 Thread Niphlod
-1 for yet another complication on the scaffolding app. @Joe: web2py has several ways to accomplish what you want, but all of them come with a cost (as anything else called "feature" in every framework of every programming language). There isn't a silver bullet that goes well with all kinds of

[web2py] SQLFORM update upload field - override 'file' anchor text

2013-11-12 Thread Jim S
I have a SQLFORM.grid on my page. I have an upload field in the referenced table/query. In edit mode on the SQLFORM.grid the upload field is displayed as a link with the text being 'file'. Is there a way to override this text? -Jim -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] Re: Loop problem

2013-11-12 Thread Richard Vézina
Oups! Thanks to clarify Niphold... Richard On Tue, Nov 12, 2013 at 2:31 PM, Niphlod wrote: > @richard: session.forget has nothing to do with forgetting the data is in > the session. it is about forgetting to save it. > > @sonu: use a scoped var (i.e. session.yourvar = dict(all_that_is_nee

Re: [web2py] Re: comma in html filename causing invalid request

2013-11-12 Thread Richard Vézina
In file name replace space with underscore, don't use special characters (stick with ascii), use dash "-" for other thing then space. Richard On Mon, Nov 11, 2013 at 1:15 PM, Leonel Câmara wrote: > It is sort of unorthodox to have commas in the path section of your URL > unless you have code to

Re: [web2py] Re: Loop problem

2013-11-12 Thread Niphlod
@richard: session.forget has nothing to do with forgetting the data is in the session. it is about forgetting to save it. @sonu: use a scoped var (i.e. session.yourvar = dict(all_that_is_needed)) and then clear it with session.yourvar = None On Tuesday, November 12, 2013 8:16:01 PM UTC+1, R

Re: [web2py] Re: Loop problem

2013-11-12 Thread Richard Vézina
Or you can just del(session.your_var)... Richard On Tue, Nov 12, 2013 at 2:15 PM, Richard Vézina wrote: > session.forget(0) I am not sure search the book about it... > > :) > > Richard > > > On Tue, Nov 12, 2013 at 1:42 PM, sonu kumar > wrote: > >> Thanks a lot. >> I have solved this problem.

Re: [web2py] Re: Loop problem

2013-11-12 Thread Richard Vézina
session.forget(0) I am not sure search the book about it... :) Richard On Tue, Nov 12, 2013 at 1:42 PM, sonu kumar wrote: > Thanks a lot. > I have solved this problem. > > one more thing I would like to ask regarding cache and session. > each time when I run my application it creates session a

Re: [web2py] Re: Web2py crash if i define model with function

2013-11-12 Thread Diogo Munaro
It's not working... 1- I tried pool_size with n = 2, 3, 6; 2- apache with prefork I just need to restart apache once a time when de database is created. It's really strange... but works... 2013/11/12 Michele Comitini > Seem a threading issue. > Try : > 1) pass a pool_size=n option with diffe

Re: [web2py] Re: I need help understanding an issue with SQLFORM.factory ( in the context of a form wizard )

2013-11-12 Thread Carlos Zenteno
Thanks for the responses. I am using the answer on Google Groups but somehow it seemed that the missing message gave the solution as why the code showed did not work. It is not working for me too, so I will keep trying. Thanks again... -- Resources: - http://web2py.com - http://web2py.com/boo

Re: [web2py] Re: Loop problem

2013-11-12 Thread sonu kumar
Thanks a lot. I have solved this problem. one more thing I would like to ask regarding cache and session. each time when I run my application it creates session and also I see last entered values on my form page. Is it possible to clean this after execution? Thanks On Tuesday, 12 November 2013

[web2py] Re: File upload through Ajax

2013-11-12 Thread Tushar Tuteja
Hey, the example isn't working I am using on ubuntu12.04 thanks, regards, On Monday, November 11, 2013 7:53:36 PM UTC+5:30, Leonel Câmara wrote: > > Here's an example: > > http://in10min.blogspot.pt/2013/04/web2py-implement-multiple-files-upload.html > > Segunda-feira, 11 de Novembro de 2013 14:

Re: [web2py] Re: Loop problem

2013-11-12 Thread Richard Vézina
Why not create a dict with the id of your data and update the key with the other data of the other table?? Something like this : dict123 = {} for r in cleavage_res: dict123[r[0]]=[r[1:]] Then for r in thmmdata: dict123[r[0]].append(r[3]) # if position is not important # or # di

[web2py] Re: Loop problem

2013-11-12 Thread sonu kumar
cleavage_res contains: 10GSPAR-PRRLP 972.48117361.5013ARPRR-LPLLS 1381.73116952.2518LPLLS-VLLLP 1905.05116428.9323VLLLP-LLGGT 2440.41115893.57 thmmdata contains: 10 iiiMMM 13 oo 18 23 MMM now I would like to present all data in

Re: [web2py] Re: web2py "Components" for layout.html and other HTML pages [ not derived from layout.html]

2013-11-12 Thread JoeCodeswell
Dear Anthony and other discussants, My original thought was JUST to *modularize *GUI entities at a more granular level. I thought of Components [as in Microsoft land] and how web2py has the Component concept. So i thought "why not use it?" Then i discovered that according to the book, web2py Co

[web2py] Re: How is the current menu styled to be horizontal?

2013-11-12 Thread JoeCodeswell
Dear Paolo, Thanks for the GREAT DETAILED reply. You indeed sensed the meaning of my original question which was related to my post - web2py "Components" for layout.html and other HTML pages [ not derived from layout.html] I will do s

[web2py] Scheduler TIMEOUT

2013-11-12 Thread LightOfMooN
How to disable timeout in scheduler? I'm using scheduler to update availability of thing from supplier site. So, I parse supplier's site, and when one url not loaded, scheduler task get status 'TIMEOUT' and stops all work. It's really bad, because there are thousands things in database, and I ca

Re: [web2py] Re: web2py "Components" for layout.html and other HTML pages [ not derived from layout.html]

2013-11-12 Thread Anthony
On Tuesday, November 12, 2013 6:36:32 AM UTC-5, viniciusban wrote: > You can use LOAD(..., ajax=False). > That will still probably result in a lot of unnecessary processing relative to using simple {{include}} statements. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Do

Re: [web2py] Re: web2py "Components" for layout.html and other HTML pages [ not derived from layout.html]

2013-11-12 Thread Anthony
OK, the original suggestion was to use Ajax components, but using {{include}}'s certainly makes sense. I'm not sure how much of this we want to do in the scaffolding app, though. It makes the code a bit more complex to follow, and for non-compiled views, it will slow down the template processin

Re: [web2py] Scheduler - a second try

2013-11-12 Thread Johann Spies
Thanks for your answer. Apologies. I have only seen your email now. I will try tomorrow. I have to go in a few minutes. Regards Johann On 12 November 2013 10:57, Niphlod wrote: > are the tables created on the server (not just scheduler_task, but also > scheduler_worker) > I find hard to bel

[web2py] Suggestion for admin Views section

2013-11-12 Thread Tito Garrido
Hi Folks, It is just a suggestion, why the views files doesn't collapse like the files in static section? I think that folders should collapse so we could easily view just the files from that folder. I am suggesting because I have a big application using a lot of views separated by folders and th

Re: [web2py] Re: Web2py crash if i define model with function

2013-11-12 Thread Michele Comitini
Seem a threading issue. Try : 1) pass a pool_size=n option with different values of n 2) use preforking instead of threading in apache configuration 2013/11/12 Diogo Munaro > Yes, thanks Michele! > > Omg, I was using web2py with apache. With the same code and using rocket > server no errors

[web2py] Re: How to use jquery get JSON in order to call web2py exteral API

2013-11-12 Thread Neil
I'm probably too late for this person, but if anyone else comes across this problem (like I just did) the answer is here: https://groups.google.com/d/msg/web2py/kSUtyNcUQGI/Ta1VowPcJMgJ As I understand it getJSON() is just a wrapper for ajax(). If you use ajax(), you have a few more options inc

Re: [web2py] Re: web2py "Components" for layout.html and other HTML pages [ not derived from layout.html]

2013-11-12 Thread Vinicius Assef
You can use LOAD(..., ajax=False). Doesn't it help you? On Tue, Nov 12, 2013 at 4:20 AM, Kiran Subbaraman wrote: > I wasn't thinking in terms of Ajax calls to stitch together these > components/templates, but rather the {{include...}} mechanism to do this. > I do agree that the current layout is

Re: [web2py] Re: Web2py crash if i define model with function

2013-11-12 Thread Diogo Munaro
Yes, thanks Michele! Omg, I was using web2py with apache. With the same code and using rocket server no errors occurs and the databases was created. I configured apache with web2py script. Someone knows whats happen? Anyway, now I can configure database with rocket than manage with apache. It's

Re: [web2py] Re: Web2py crash if i define model with function

2013-11-12 Thread Michele Comitini
The error you sent seems to point to some statement that has not been properly closed. The commit/rollback happens in the middle of an open statement? That is what mysql seems to say. The problem could be earlier than when the error raises. Hard to say where. You could try to force db.commit/ro

[web2py] Re: What's the state of background.py (running code in separate threads) ?

2013-11-12 Thread Niphlod
depends on what are you talking about. if you're talking about the scheduler, then its definitely stable (as long as you stick to the documented API). the separation is made exactly for the usecase you're experiencing: web apps should return webpages fast while something else crunches data. --

Re: [web2py] Scheduler - a second try

2013-11-12 Thread Niphlod
are the tables created on the server (not just scheduler_task, but also scheduler_worker) I find hard to believe (or, at least, I was never able to verify) that on the first round with only one worker the worker itself can't successfully commit a query that basically doesn't do nothing (because

[web2py] Re: Database insert of time field in web2py not working?

2013-11-12 Thread Niphlod
requires can be a list of validators. On Tuesday, November 12, 2013 9:32:27 AM UTC+1, User wrote: > > Just realized I added the following lines after my db.define_table > statement: > > db.sometable.start_time.notnull = True > db.sometable.start_time.requires = IS_NOT_EMPTY() > > > I'm th

[web2py] Re: Database insert of time field in web2py not working?

2013-11-12 Thread User
Just realized I added the following lines after my db.define_table statement: db.sometable.start_time.notnull = True db.sometable.start_time.requires = IS_NOT_EMPTY() I'm thinking that my assignment of IS_NOT_EMPTY() overwrote the default IS_TIME() validator associated with time fields. Doe

[web2py] Database insert of time field in web2py not working?

2013-11-12 Thread User
I have some code that was working before but I can't quite pinpoint why it's not working now. In any case it's a time field in a table and when I insert into this field the database shows '00:00:00' in the field (by looking at the record in an SQLite admin tool) Field('start_time','time'