[web2py] Re: PostgreSQL migrate / fake_migrate_all failure with relation does not exists

2014-12-01 Thread Paolo Valleri
Hi Tom, wiki's tables are not present. You have to include them during the migration, probably you have defined the wiki object in a controller? Paolo On Saturday, November 29, 2014 6:22:00 PM UTC+1, Tom Øyvind Hogstad wrote: My migrations suddenly failed with Error: class

[web2py] Re: add task and wait the result

2014-12-01 Thread Niphlod
On Sunday, November 30, 2014 1:51:37 PM UTC+1, nick name wrote: Is that true even with immediate=True? If so, what is the recommended way to reduce this to 0.5 seconds or so? I have an app in which a user requests somethng; that request launches 1-10 other web requests, and the user keeps

[web2py] SQLFORM.grid field is not empty if another field is full

2014-12-01 Thread Yebach
Hello I have a SQLFORM.grid and I have to raise error for user if he inserts value into one field and not another. Example start 1 10:00 end 1 12:00 - has to show error if field is empty - start 2 16:00 - not necessary to be inserted end 2 20:00 - has to show error if start 2 is not empty

Re: [web2py] update_or_insert error

2014-12-01 Thread Johann Spies
On 28 November 2014 at 07:26, T.R.Rajkumar t.r.rajkuma...@gmail.com wrote: When I do update_or_insert into a table in postgresql I get the following error. My code is below. class 'gluon.contrib.pg8000.errors.ProgrammingError' ('ERROR', '42601', 'syntax error at or near ') What does the

Re: [web2py] syntax for making var appear in view

2014-12-01 Thread Johann Spies
On 1 December 2014 at 09:23, Alex Glaros alexgla...@gmail.com wrote: Question one: This is in controller: vars=dict(Alex=99) This is in view: brAlex = {{ =response.get_vars.Alex}} br error is: 'NoneType' object has no attribute 'Alex'. I assume this is not the way to get a var to show

[web2py] Re: syntax for making var appear in view

2014-12-01 Thread Anthony
On Monday, December 1, 2014 2:23:25 AM UTC-5, Alex Glaros wrote: Question one: This is in controller: vars=dict(Alex=99) This is in view: brAlex = {{ =response.get_vars.Alex}} br Assuming the first line is in a call to the URL() function and the view in question is that of the linked

[web2py] Re: SQLFORM.grid field is not empty if another field is full

2014-12-01 Thread Anthony
You can either use an onvalidation function or do something like: Field('end1', requires=IS_NOT_EMPTY() if request.post_vars.start1 else None) Anthony On Monday, December 1, 2014 8:27:30 AM UTC-5, Yebach wrote: Hello I have a SQLFORM.grid and I have to raise error for user if he

[web2py] Custom validator - pass record id to validator for update operations

2014-12-01 Thread clara
Hello all, I am developing a web2py application and I am writing the logic to control stock of certain items. To that end, I wrote a custom validator which is working fine when creating new sale items. Now the problem arises when updating these sale items, because I would need to know the

[web2py] Subclassing IS_IN_SET - one piece missing.

2014-12-01 Thread Andrew Buchan
Hi, I wanted to create a validator which creates a dropdown of users in a certain auth group. I figured I could shortcut this by inheriting from IS_IN_SET, see class below. This works fine for SQLFORMS in create mode (drop dow with just what I want to see) and for read-only mode (I see the

[web2py] Re: Custom validator - pass record id to validator for update operations

2014-12-01 Thread Andrew Buchan
Hi Clara, I think (someone please correct me if I'm wrong -- and have a look at my other question posted just after this :D) that the validator has no access to the record. But because you can set the validator on a field at any time, one solution is to chang your validator class so it knows

Re: [web2py] Re: Web2py's included connection pooling VS external pooling software

2014-12-01 Thread Lisandro Rostagno
Sorry about the delay. I recently installed pgbouncer. I let postgresql max_connection set to 80, and configure pgbouncer with a max_client_conn of 1000 and a default_pool_size of 20. Now when I check pg_stat_activity I can see different amounts of idle connections per app, more accordingly with

[web2py] Re: Forcing download of generated PDF

2014-12-01 Thread Omar Meat Boy Gutiérrez
With: return response.stream(open(path, 'rb')) You need save your file first, using tempfile maybe. On Wednesday, October 29, 2014 12:13:39 PM UTC-5, Jason Solack wrote: Hello everyone, i'm generating a PDF using pdfkit and i'd like my function to force the download of the pdf file i'm

[web2py] Re: Forking/multiprocessing bug triggered by Web2Py launch directory

2014-12-01 Thread Massimo Di Pierro
Please open a ticket about this. On Sunday, 30 November 2014 02:03:18 UTC-6, Roshan Mathews wrote: It's been a month since my post, so I was wondering if anyone has any hints they might want to share about this. Thanks, rm On Friday, 31 October 2014 19:32:06 UTC+5:30, Roshan Mathews

Re: [web2py] Re: Web2py's included connection pooling VS external pooling software

2014-12-01 Thread Niphlod
@lisandro: michele is right.. the pool_size parameter calculation are accurate only if there's one process per app. web2py can't coordinate pools among different processes... also, max_client_conn is exactly the maximum number of connection the pgbouncer process will allow coming in. Once over

[web2py] nginx one ip two web2py applications two non web2py websites

2014-12-01 Thread BlueShadow
Hi, I got one server with one ip. And I have a total of 4 websites. two web2py apps and two non web2py apps. I had that configured and working a year ago. and can't remember how I did it. I updatet web2py and now all web2py urls are redirected to one of the non web2py websites. Can anyone tell

[web2py] Re: Subclassing IS_IN_SET - one piece missing.

2014-12-01 Thread Niphlod
why reinventing the wheel ? IS_IN_DB takes a Set... gr = db.auth_group me = db.auth_membership us = db.auth_user theset = db( (us.id == me.user_id) (gr.id == me.group_id) (gr.role == 'roletest') ) Field('a_field', requires=IS_IN_DB(theset, 'auth_user.id', '%(first_name)s -

Re: [web2py] Re: Web2py's included connection pooling VS external pooling software

2014-12-01 Thread Michele Comitini
What you have here is lighttpd starting 1 forking flup server. The important part is this: from flup.server.fcgi_fork import WSGIServer With that you have a python interpreter for each request, up to a maximum. The default is 5 spare children, the default maximum is 50. Under lighttpd is also

[web2py] Re: nginx one ip two web2py applications two non web2py websites

2014-12-01 Thread Niphlod
as long as you have 4 sites stanzas I can't see where the issue could be server { listen 80 ; server_name blabla1.com .. } server { listen 80 ; server_name blabla2.com .. } server { listen 80 ; server_name blabla3.com .. }

[web2py] Re: nginx one ip two web2py applications two non web2py websites

2014-12-01 Thread pang
If by two web2py apps you mean two different web2py installations (with the web2py code duplicated, so that they can run different versions of web2py, for example), then I can say: we recently followed this tutorial:

[web2py] Re: nginx one ip two web2py applications two non web2py websites

2014-12-01 Thread BlueShadow
I'm stupid. I had the $hostname still in the conf file in sites-available thanks Niphlod. On Monday, December 1, 2014 9:44:36 PM UTC+1, BlueShadow wrote: Hi, I got one server with one ip. And I have a total of 4 websites. two web2py apps and two non web2py apps. I had that configured and

Re: [web2py] Re: Web2py's included connection pooling VS external pooling software

2014-12-01 Thread Lisandro Rostagno
Thank you very much Niphlod and Michele for your help! Now I have a more clear understanding of all this. I understand now why I was seeing 5 fastcgi processes regardless of the max-procs configuration (that was because I was using fcgi_fork, and I was actually seeing one process and its 5

[web2py] Re: Dynamic Upload Uploadfolder

2014-12-01 Thread James Burke
Any ideas? Cheers On Monday, December 1, 2014 11:46:57 AM UTC+13, Massimo Di Pierro wrote: You cannot do this uploadfolder= lambda r:... But this is a chicken-egg problem. You want r to be the row but the row is not created until after the file is uploaded therefore you cannot specify the

[web2py] Displaying blob image on login page

2014-12-01 Thread Prasad Muley
Hi All, I need to display logo according to url in login page. I tried to display the logo but it always shows *404 not found* error on login page. My app settings are below: *models/db.py* db.define_table('company', Field('name', 'text', notnull=True),

[web2py] Re: Displaying blob image on login page

2014-12-01 Thread Mandar Vaze
From http://stackoverflow.com/questions/22580518/display-image-from-database-in-the-html-form-using-php - you can try setting img src=data:image/gif;base64,' On Tuesday, December 2, 2014 12:09:25 PM UTC+5:30, Prasad Muley wrote: Hi All, I need to display logo according to url in

[web2py] Re: Displaying blob image on login page

2014-12-01 Thread Mandar Vaze
http://stackoverflow.com/questions/16279856/converting-blob-stored-on-a-database-to-an-image-on-an-html-website On Tuesday, December 2, 2014 12:09:25 PM UTC+5:30, Prasad Muley wrote: Hi All, I need to display logo according to url in login page. I tried to display the logo but it

[web2py] Re: update_or_insert error

2014-12-01 Thread T.R.Rajkumar
In the error page I find the following in the arguments. *File F:\trr\web2py\web2py\gluon\dal.py in update_or_insert at line 9380* code arguments variables Function argument list (self=Table cms_meas_details (id,meas_id,agt_no,jcod,...,m_content,remarks,update_uid,update_dt,line_no),

Re: [web2py] Re: Displaying blob image on login page

2014-12-01 Thread Prasad Muley
I've tried both solutions and it's not working here 1) decode is giving me following error. 27.0.0.1.2014-12-02.13-01-39.af379677-6327-4f4c-bc93-5ed1e5e02ed8 class 'binascii.Error' Incorrect padding 2) Second option is not working. I've printed image path but it didn't display

[web2py] Like the 1st example in the web2py book, can I customize my session.counter to count all sessions?

2014-12-01 Thread Gideon George
Please what I can do if I want to display the number of visits to each page of my site without restricting it to just individual sessions? Unlike the code below where it displays number of visits for a particular session, I want a situation where by I can put something like this at my

[web2py] dummy database to hold legacy db

2014-12-01 Thread chuan
Hi, I manage data from different people and display selected data on page. Therefore I work with a lot of legacy databases. I can automatic extract tables from these external dbs, then put them into a list of DAL objects. How can I unify the tables into one single db? Then the controller will

[web2py] web2py doesn't retrieve the latest user-memberships from ldap.

2014-12-01 Thread Dennis Jacobs
Hi Guys, I've a small question regarding the auth-module when using ldap. I know that when a user doesn't exist in the web2py tables, web2py will retrieve the user along it's membership into the db upon his first login. However i've noticed that web2py doesn't uypdate this info when the user is

[web2py] using a requirements file with a web2py application

2014-12-01 Thread Jason Solack
Hello, i'm deploying some sites to apache and i'm wondering if there's built in support for a requirements file to ensure my project is using the correct versions of packages. I had a recent sitiuation where updating pandas created a bit of headache and i'd like to avoid that in the future by

[web2py] How to upload web2py code to git

2014-12-01 Thread Andrea Baric
Hi everyone, I am trying to figure out how to upload my code to GitHub from one of my applications on web2py. This must be simple to do without saving every file locally! Please help? Thanks! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: PostgreSQL migrate / fake_migrate_all failure with relation does not exists

2014-12-01 Thread Tom Øyvind Hogstad
Using the wiki as an example was a bit stupid. This happens to all my tables with a foreign key. The tables exist, but it happens when i add a field. As I understand fake_migrate it regenerates the meta data in databases. So if I first fake_migrate on the database that is exactly the same as my

[web2py] Re: form warning

2014-12-01 Thread Alen Cerovic
Thank you Massimo, here is my situation: I would like to check if LastName and FirstName already exist in database and warn user but allow him to proceed (there are people with sam name and lastname). The idea is to issue a warning when user have just these two fields filled so that he do not

[web2py] Re: Getting Log details

2014-12-01 Thread Research Kamal
Hi anybody knows how to view the log details in web2py framework? Let me know, i am waiting for the reply On Friday, November 28, 2014 4:12:32 PM UTC+5:30, Research Kamal wrote: Hi to all, I have an web2py framework and it is very good, and i want to know about some details like how to get

[web2py] long running rpc call

2014-12-01 Thread Matt Broadstone
Hi, We're making a number of rpc calls to other services using jsonrpc, and a few of them are particularly long running. I'd rather not use the scheduler, but instead was wondering if I could associate a jsonrpc httpclient in python to the current context so that longer tasks wouldn't block

[web2py] Re: Displaying blob image on login page

2014-12-01 Thread Massimo Di Pierro
Here: logo = IMG(_src = URL('default', 'show_logo', company_rec['logo'])) should be logo = IMG(_src = URL('default', 'show_logo', args=company_rec['logo'])) On Tuesday, 2 December 2014 00:39:25 UTC-6, Prasad Muley wrote: Hi All, I need to display logo according to

Re: [web2py] Re: Displaying blob image on login page

2014-12-01 Thread Prasad Muley
Thanks Massimo, It works :) On Tue, Dec 2, 2014 at 1:13 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Here: logo = IMG(_src = URL('default', 'show_logo', company_rec['logo'])) should be logo = IMG(_src = URL('default', 'show_logo', args=company_rec['logo']))

[web2py] Re: SQLFORM.grid field is not empty if another field is full

2014-12-01 Thread Yebach
Thanx. Nice solution On Monday, December 1, 2014 2:46:24 PM UTC+1, Anthony wrote: You can either use an onvalidation function or do something like: Field('end1', requires=IS_NOT_EMPTY() if request.post_vars.start1 else None) Anthony On Monday, December 1, 2014 8:27:30 AM UTC-5,