Re: [web2py] Re: "Duplicate headers received from server" on Google Chrome

2012-12-10 Thread Mandar Vaze / मंदार वझे
On Mon, Dec 10, 2012 at 8:48 PM, Niphlod wrote: > This patch > https://github.com/web2py/web2py/commit/5e7de996e023a21247d4a9b05a55755d42478895 > shows that it's fixed already. Aha .. Seems like it is fixed in 2.3.0 I am still on 2.2.1 Good to know this is fixed. -Mandar --

[web2py] Re: web2py winservice

2012-12-10 Thread Tim Richardson
On Tuesday, 11 December 2012 14:38:47 UTC+11, Massimo Di Pierro wrote: > > Thanks for reporting this. It should not be fixed in trunk and nightly > build. I was unable to test so, please let me know if it works The win2py service installs again. --

[web2py] Re: problem with latest trunk SQLFORM.grid

2012-12-10 Thread tomt
I simplified the controller to better understand the problem I'm seeing. def test(): id = 2 query = (db.staffnotes.staffid == id) fields=[db.staffnotes.staffid,db.staffnotes.date,db.staffnotes.comment] orderby = [~db.staffnotes.date,~db.staffnotes.modified_on] grid = SQLFORM.gr

[web2py] Re: web2py winservice

2012-12-10 Thread Massimo Di Pierro
Thanks for reporting this. It should not be fixed in trunk and nightly build. I was unable to test so, please let me know if it works. On Monday, 10 December 2012 21:05:39 UTC-6, Tim Richardson wrote: > > The problem I think is that in widget.py this is in an exception block: > >from winserv

[web2py] Re: web2py winservice

2012-12-10 Thread Tim Richardson
The problem I think is that in widget.py this is in an exception block: from winservice import web2py_windows_service_handler but winservice.py there has been a name change you have this now: def register_service_handler( instead of the old: def web2py_windows_service_handler( On Tuesd

[web2py] Re: web2py winservice

2012-12-10 Thread Tim Richardson
It's an ActiveState python installation which includes these extensions. On the same machine, I don't get the error with a 2.2.1 source download, the service installs fine. On Tuesday, 11 December 2012 11:34:15 UTC+11, Massimo Di Pierro wrote: > > You need Mark Hammond win 32 extensions. > > O

Re: [web2py] Re: web3py?

2012-12-10 Thread Robert Clark
Nice, that is great news that it already behaves like this :). Definitely gets my vote. I couldn't see these details elaborated in the web3py thread so was aiming to suggest some clear rules. Guess that makes these suggestions syntactic only. Still to try web3py, will do soon. On Mon, Dec 10,

[web2py] Re: Shared tables and enable_record_versioning dilemma. Two apps trying to create archive table.

2012-12-10 Thread Cliff Kachinske
Thank you. I think it should work as you described. Should I submit a bug report? --

Re: [web2py] Re: Should I restart nginx when routes.py changes?

2012-12-10 Thread Jonathan Lundell
On 10 Dec 2012, at 5:43 PM, Vinicius Assef wrote: > > I forgote the link to pastebin. > > Here it is: http://pastebin.com/i0gk9xik FWIW, the parametric router has a policy of always being able to accept an explicit URL (full /a/c/f/args?vars). It's careful when rewriting outgoing URLs for UR

[web2py] web2py command line -taskbar parameter bug?

2012-12-10 Thread Rob Paire
This afternoon I upgrade my web2py environment from 1.99.7 to 2.2.1; after upgrading I noticed the batch file that starts web2py did not work correctly - the interface appeared on 127.0.0.1 instead of 192.168.1.6. After fiddling around with this I discovered the -i parameter is NOT respected wh

Re: [web2py] Re: Should I restart nginx when routes.py changes?

2012-12-10 Thread Vinicius Assef
I forgote the link to pastebin. Here it is: http://pastebin.com/i0gk9xik -- Vinicius Assef On Mon, Dec 10, 2012 at 1:45 PM, Vinicius Assef wrote: > Thank you Jonathan and Niphlod. > > I'm working with routes and trying to normalize things to have just > one version of myapp/routes.py running l

[web2py] Re: The Decimal dilemma and the Validator that Doesn't

2012-12-10 Thread Joe Barnhart
OMG! I can't believe I found the problem within minutes of posting. Note to self: Spelling is important when programming! In other words, "def fomatter" is NOT the same as "def formatter". -- Joe B. On Monday, December 10, 2012 4:53:39 PM UTC-8, Joe Barnhart wrote: > > So my web app takes mo

Re: [web2py] Re: high availability

2012-12-10 Thread Michele Comitini
I suppose Oli would like to use sqlrelay native driver, not the posgresql or mysql emulation. In that case it would act just as another DBAPI adapter and by supporting it into the DAL it would make a number of DBs available just with one driver. It is similar to ODBC in many aspects, and much bett

[web2py] The Decimal dilemma and the Validator that Doesn't

2012-12-10 Thread Joe Barnhart
So my web app takes money. Filthy grubby money. But only in small quantities, amounts which could easily be represented by "decimal(5.2)". Trying that in my table, however, leads to unexpected results -- I get FOUR places after the decimal in my forms instead of two. But only if there are p

[web2py] Re: Jquery issues with IE 9

2012-12-10 Thread Massimo Di Pierro
Web2py 2.3.1 will ship with j jQuery v1.8.2. Does that solve the problem? On Monday, 10 December 2012 14:57:11 UTC-6, vinoth abmcg wrote: > > Hi, >I have been using web2py - 2.2.1 stable version along with Jquery > 1.8.0. The Application i developed working good in Firefox, but in IE 9 the

[web2py] Jquery issues with IE 9

2012-12-10 Thread vinoth abmcg
Hi, I have been using web2py - 2.2.1 stable version along with Jquery 1.8.0. The Application i developed working good in Firefox, but in IE 9 the problem i am getting is "The value of the property '$' is null or undefined, not a Function object". It does not evaluate the Jquery function. I

[web2py] Conflicts when using PAM, Usernames and MULTI_USER

2012-12-10 Thread Jodi Curtis
Hi Recently I started to work with web2py After initially creating a password for the www_data user and using the admin login feature with no username or email request needed. All going well, I set about enabling PAM and MULTI_USER auth, so I could add PAM users to Linux and automatically have

[web2py] Re: web2py winservice

2012-12-10 Thread Massimo Di Pierro
You need Mark Hammond win 32 extensions. On Monday, 10 December 2012 17:59:39 UTC-6, Tim Richardson wrote: > > I get an error under windows 7 > > python web2py.py -W install > > web2py Web Framework > Created by Massimo Di Pierro, Copyright > Version 2.3.0 (2012-12-09 14:28:45) rc1 > Database driv

[web2py] Re: web3py?

2012-12-10 Thread Massimo Di Pierro
web3py does that already. Although it does not support the exact syntax you proposed. Did you try it? On Monday, 10 December 2012 17:42:20 UTC-6, Robert Clark wrote: > > A couple of days ago in the "web3py important!" thread I posted some > thoughts on URL route matching syntax for the @expose(.

Re: [web2py] Re: Unexposed Action?

2012-12-10 Thread Massimo Di Pierro
Any objection? On Monday, 10 December 2012 16:38:26 UTC-6, Niphlod wrote: > > > On Monday, December 10, 2012 8:59:23 PM UTC+1, Jonathan Lundell wrote: >> >> On 10 Dec 2012, at 11:54 AM, Niphlod wrote: >> >> +1 for the semplification. def test () (space between test and the first >> parenthesis)

[web2py] Re: Add button to form & access from view

2012-12-10 Thread Massimo Di Pierro
This is not worth it. If you make a custom form than you are using html, you may as well make the button in html. On Monday, 10 December 2012 15:15:30 UTC-6, Daniele wrote: > > When I use form.add_button() I am able to add a button to a form, which I > can display with {{=form}} in my view. > >

[web2py] Re: How to "fix" CRYPT differences between Windows and Linux?

2012-12-10 Thread Massimo Di Pierro
You should not publish your key. What I am saying is that as online as your key is the same used to create the hashes, the CRYPT validators should do the right job. If you want your dev app and production to share data, they must share the same key. Another option is not using the key at all.

[web2py] Re: problem importing dbconnection - works on first request after server start then shows zero rows

2012-12-10 Thread Massimo Di Pierro
You should now make web global. Imagine two requests arrive more or less at the time time. Both call connect? Now you have two threads using the same global web object. You are back to the previous problem. This breaks connection pooling, thread safety, etc. You either call db = DAL() at each r

[web2py] Re: web2py winservice

2012-12-10 Thread Tim Richardson
I get an error under windows 7 python web2py.py -W install web2py Web Framework Created by Massimo Di Pierro, Copyright Version 2.3.0 (2012-12-09 14:28:45) rc1 Database drivers available: SQLite(sqlit IMAP(imaplib) Error: Missing python module winservice I moved web2py the top of my home direct

[web2py] Re: web3py?

2012-12-10 Thread Robert Clark
A couple of days ago in the "web3py important!" thread I posted some thoughts on URL route matching syntax for the @expose() method, but my post is yet to surface. Posting a more-considered version here for consideration and feedback. I've been looking into some other frameworks, and Alloy

Re: [web2py] Re: Unexposed Action?

2012-12-10 Thread Niphlod
On Monday, December 10, 2012 8:59:23 PM UTC+1, Jonathan Lundell wrote: > > On 10 Dec 2012, at 11:54 AM, Niphlod > > wrote: > > +1 for the semplification. def test () (space between test and the first > parenthesis) should be avoided. > > > They're ignored in the current trunk, unless/until Mas

[web2py] Re: Shared tables and enable_record_versioning dilemma. Two apps trying to create archive table.

2012-12-10 Thread Niphlod
Than it's a bug, file an issue on google code. For the time being just copy the table_archive .table file from the 1st app to the second one in the databases/ folder. I don't have the time to provide a patch but poking around the code in dal.py the _enable_record_versioning() method doesn't "pro

[web2py] Re: Integrity error with IS_NULL_OR( IS_IN_DB() )

2012-12-10 Thread Derek
Of course, you should follow the web2py principle - "everything should have a default behavior". Default the priority to the lowest possible, or the most frequently used value. On Monday, December 10, 2012 3:33:15 PM UTC-7, Derek wrote: > > The problem with IS_IN_DB is that it creates a foreign

[web2py] Re: Integrity error with IS_NULL_OR( IS_IN_DB() )

2012-12-10 Thread Derek
The problem with IS_IN_DB is that it creates a foreign key constraint - It appears you have 'zero="choose one"' - you're adding a foreign key that isn't actually in the database. I'd suggest that you add "choose one" to the "requirement_priorities" table, and add in validation logic to throw an

Re: [web2py] Question about ondelete='CASCADE'

2012-12-10 Thread Niphlod
we should see the model and the traceback. Some db engines are more permissive than others. Often the cause of the issue is some sort of "unique" or "notnull" costraint set on the referenced table. On Monday, December 10, 2012 10:30:15 PM UTC+1, Richard wrote: > > Hello, > > My app raise issue w

[web2py] Re: How would I move SQLFORM.smartgrid buttons to first column?

2012-12-10 Thread Niphlod
it's not documented yet maybe but in trunk there are 2 parameters to "influence" the position for both of buttons and links, namely buttons_placement and links_placement. They have a default = 'right' but can take 'left' or 'both' too. On Monday, December 10, 2012 10:33:15 PM UTC+1, JimK wrote:

[web2py] Re: Integrity error with IS_NULL_OR( IS_IN_DB() )

2012-12-10 Thread Cliff Kachinske
db[t.requirements].requirement_priority_id.required = IS_NULL_OR(... should be db[t.requirements].requirement_priority_id.requires = IS_NULL_OR(... On Tuesday, November 27, 2012 4:11:51 PM UTC-5, israelord wrote: > > Hi there! and greetings from Caracas - Venezuela, > > I started using web2py rece

[web2py] How would I move SQLFORM.smartgrid buttons to first column?

2012-12-10 Thread JimK
When I create a SQLFORM.smartgrid object, the edit, view and delete buttons are displayed all of the way to the right. If the table has many columns, it requires scrolling to the right to access them. Is there a way to move the button column to the first position? Alternatively, is there a wa

[web2py] Question about ondelete='CASCADE'

2012-12-10 Thread Richard
Hello, My app raise issue when someone delete a record referenced by a other table. I this table I set for the reference field ondelete='NO ACTION', but as far as I understand it not solve noting since table1 (the referenced table) will not look at table2 definition to know what todo on delete.

[web2py] Add button to form & access from view

2012-12-10 Thread Daniele
When I use form.add_button() I am able to add a button to a form, which I can display with {{=form}} in my view. However, if I'm making a custom form using form.custom, how can I display that button?? Thanks --

Re: [web2py] Integrity error with IS_NULL_OR( IS_IN_DB() )

2012-12-10 Thread Richard Vézina
Just for you to know : IS_NULL_OR IS_NULL_OR Deprecated, an alias for IS_EMPTY_OR described below. Better use IS_EMPTY_OR(...) We should see your model to better understand what's going on. Richard On Tue, Nov 27, 2012 at 4:11 PM, israelord < israel.fer...@lechuzacomunicaciones.com> wrote: >

[web2py] Re: How to make associations of users to the content they produce?

2012-12-10 Thread Cliff Kachinske
use db._common_fields.append(auth.signature) in your model file. Read all about it here. Use your browser's search to find auth.signature. Then in your index query use db.comment.created_by==session.auth.user.id # users must be logged in for this

[web2py] Re: Shared tables and enable_record_versioning dilemma. Two apps trying to create archive table.

2012-12-10 Thread Cliff Kachinske
Niphlod, It still tries to define the table even if migrate is False. There is code something like this in the shared tables: init_migrate = True if request.application != 'init': init_migrate = False db.define_table('attachments' ., migrate=init_migrate ) On Monday, December 10

[web2py] Re: case insensitive email problems

2012-12-10 Thread Mark
Just found out that adding following setting will solve the "register duplicated accounts" problem. auth.settings.table_user.email.requires.insert(0,IS_LOWER()) But request_reset_password still didn't work well. Still treat "t...@gmail.com" as an unknown email. In the gluon.tools, I found foll

[web2py] Re: Example that should be included in the manual for multiple left joints

2012-12-10 Thread Magnitus
Just thought of something... this statement can be removed from the example: "Also assume that in your app, all users belong to only one group." I thought about None duplicates, but there should be none. Other groups should be filtered out by the belongs part of the left join for the auth_group

[web2py] How to make associations of users to the content they produce?

2012-12-10 Thread sasogeek
I want to have multiple users using my app and each content they produce will be entitled to their accounts, that way if you make a comment for example, your name will be by the comment and if another user should see the comment, they'll see your name by the comment. if i can do this, i believe

Re: [web2py] Re: Unexposed Action?

2012-12-10 Thread Jonathan Lundell
On 10 Dec 2012, at 11:54 AM, Niphlod wrote: > +1 for the semplification. def test () (space between test and the first > parenthesis) should be avoided. They're ignored in the current trunk, unless/until Massimo reverts it. > > On Monday, December 10, 2012 7:54:54 PM UTC+1, Jonathan Lundell

Re: [web2py] Re: Unexposed Action?

2012-12-10 Thread Niphlod
+1 for the semplification. def test () (space between test and the first parenthesis) should be avoided. On Monday, December 10, 2012 7:54:54 PM UTC+1, Jonathan Lundell wrote: > > On 10 Dec 2012, at 10:53 AM, Jonathan Lundell > > > wrote: > > On 9 Dec 2012, at 2:56 PM, Massimo Di Pierro > >

[web2py] Re: Shared tables and enable_record_versioning dilemma. Two apps trying to create archive table.

2012-12-10 Thread Niphlod
does setting migrate=False in the 2nd app (recommended method) trigger the table definition ? On Monday, December 10, 2012 8:08:18 PM UTC+1, Cliff Kachinske wrote: > > I have several applications that share tables. One such is called > "attachments." > > As part of my upgrade to 2.2.1, I enabl

[web2py] Example that should be included in the manual for multiple left joints

2012-12-10 Thread Magnitus
I must have spent a good hour hammering at this before I got it right. Maybe rephrase it a bit, but I think it's a good example... Assume that you want all users returned, but want to outline specifically those belonging to group A or B (with the others having their group set to None) in one qu

[web2py] Re: How to "fix" CRYPT differences between Windows and Linux?

2012-12-10 Thread JoeCodeswell
Thanks for the response, Massimo. I have the auth.key. However, I am a bit concerned about publishing it here since I have potential clients that are looking at myapp on webfaction right now. I am concerned about what i have already published. What do you suggest I do? Thanks in advance. Lov

[web2py] Shared tables and enable_record_versioning dilemma. Two apps trying to create archive table.

2012-12-10 Thread Cliff Kachinske
I have several applications that share tables. One such is called "attachments." As part of my upgrade to 2.2.1, I enabled record versioning in each of these apps. I have a specific sequence for opening appadmin in these applications to migrate the tables in case of changes. When I migrated

Re: [web2py] Re: Unexposed Action?

2012-12-10 Thread Jonathan Lundell
On 10 Dec 2012, at 10:53 AM, Jonathan Lundell wrote: > On 9 Dec 2012, at 2:56 PM, Massimo Di Pierro > wrote: >> There are three ways: >> >> - function takes arguments >> - function name is prefixed by __ >> - there is a space between the function name and (). (*) >> >> I do not like (*) very m

Re: [web2py] Re: Unexposed Action?

2012-12-10 Thread Jonathan Lundell
On 9 Dec 2012, at 2:56 PM, Massimo Di Pierro wrote: > There are three ways: > > - function takes arguments > - function name is prefixed by __ > - there is a space between the function name and (). (*) > > I do not like (*) very much and I cannot really promise will stay in the > future since i

[web2py] Re: problem with latest trunk SQLFORM.grid

2012-12-10 Thread tomt
Yes, I am logged in. On the initial call of the controller the grid is displayed without and error. When I select a new value from the dropdown form, a new query is used and passed to SQLFORM.grid, and this is when the 'not authorized' flash is generated. On Monday, December 10, 2012 9:21

[web2py] Re: problem importing dbconnection - works on first request after server start then shows zero rows

2012-12-10 Thread simon
OK. I think I have done something similar to your suggestion. It seems to work but not sure about memory leaks. Also I note there is no web2py method to close a database connection. I want to put all the code interfacing to a 3rd party system in a single file. In that way if I change to a diffe

[web2py] Re: recursive error when including sidebar view

2012-12-10 Thread jonas
ok, that solved the problem. Thanks On Monday, December 10, 2012 4:46:12 PM UTC+1, Anthony wrote: > > > > and in layout.html: >> >> >> {{if left_sidebar_enabled:}} >> >> >> >> >> >> {{include 'sidebar.html'}} >> > > In layout.html you include sidebar.html, but then

[web2py] Issue 1211: form.process input parameter keepvalues=True not working

2012-12-10 Thread wwwgong
I just raised Issue 1211 with more details. In short, keepvalues=True input seems to be ignored when used with onvalidation. but form.process(keepvalues=True) is ok. Thanks, Wen def insert_numbers(): form = SQLFORM(db.numbers) if form.process(keepvalues=True,onvalidation=my_form_processin

Re: [web2py] Re: scheduler problem in trunk when using datetime as return value?

2012-12-10 Thread Jonathan Lundell
On 10 Dec 2012, at 7:49 AM, Massimo Di Pierro wrote: > I think we should use gluon.serializers.json which handles this case. In some of my cross-platform JSON I've been using (float) seconds since the (1970) epoch: time.time() instead of datetime.datetime.utcnow(), for example. > > On Monday

[web2py] Re: no such column: content.id

2012-12-10 Thread sasogeek
Thanks :) that worked. A new problem emerged though so I'll post that one in a new thread. Thanks again. On Monday, 10 December 2012 15:27:12 UTC, Niphlod wrote: > > I think that the problem is this: > db.comment.content_id.default = db.content.id > > You can't set a default value that is a Field

[web2py] Re: Subfolders in models

2012-12-10 Thread Anthony
> > I've been testing the way you described above and it works, to a point. > The models are not imported in alphabetical order. This seems to be > controlled by this line (521): models = listdir(path, '^\w+\.py$', 0, sort=False) in compileapp.py > listdir is essentially os.walk with a regexp f

[web2py] Re: Shopping cart example

2012-12-10 Thread Massimo Di Pierro
This app contains one: https://github.com/mdipierro/web2py-appliances/tree/master/PosOnlineStore On Monday, 10 December 2012 05:56:29 UTC-6, Omkar Patil wrote: > > Hi, I am new to web2py. Can anyone give me a good shopping cart example. > > Regards, > Omkar > --

[web2py] Re: I do not use cache, but the system cache throws me errors .. : S

2012-12-10 Thread Anthony
> > id_user = (auth.user and auth.user.id) or None Also, note that the above is simply equivalent to auth.user_id (i.e., its value is None if there is no auth.user). Anthony --

[web2py] Re: web2py + mongrel2

2012-12-10 Thread Massimo Di Pierro
I cannot say about EC2 specifically but if you have mongrel2 installed python anyserver.py -s mongrel2 will start web2py with mongrel2. anyserver,py ships with web2py. It requires this library: http://sheddingbikes.com/posts/1279007133.html On Monday, 10 December 2012 02:40:39 UTC-6, dbv wrot

[web2py] Re: how valid is web2py for my situatuion??

2012-12-10 Thread Massimo Di Pierro
I assume you want to keep your vb application and not rewrite it in python. If that is the same as you say the problem is communication between the VB and web2py. They can communicate via sharing a DB (a MSSQL db) or by file buffers or by sockets (probably un-necessarily complicated). Unless yo

[web2py] Re: I do not use cache, but the system cache throws me errors .. : S

2012-12-10 Thread Anthony
plugin_inscripcion_temp_id = request.args[0] Well, somehow request.args[0] is taking on the value "cache" rather than being an integer ID as you expect. Again, can't say how that is happening without seeing the code that generates the URL that calls the planilla function. Note, you can do requ

[web2py] application of web2py and some help

2012-12-10 Thread Hemant Puthran
Hi all; i have a visual basic aplllication that reads data from instruments and in some cases helps me change the values i have to make a web application so that this can be accesed through lan or net i have a few questions 1.is such an application can be developed through web2py or should i use

[web2py] Re: EC2 Ubuntu Install without Apache

2012-12-10 Thread dbv
Sorry to hassle, but: a. What is the recommended process to install web2py on an EC2 instance without Apache (see original note)? b. What is the recommended method to connect to web2py on an EC2 instance from Windows to access the Admin facility - we're currently using WinSCP and PuTTy (see Ric

[web2py] web2py + mongrel2

2012-12-10 Thread dbv
What is the recommended process to configure web2py with mongrel2 on an EC2 instance? I know that there were a few posts on this subject early this year but wanted to check if there was a consensus solution? Assume that mongrel2 is already installed and working. Thx. --

[web2py] Shopping cart example

2012-12-10 Thread Omkar Patil
Hi, I am new to web2py. Can anyone give me a good shopping cart example. Regards, Omkar --

[web2py] how valid is web2py for my situatuion??

2012-12-10 Thread Hemant Puthran
Hi all, i have an application in visual basic that reads and helps me monitor instruments and even change the their values.my problem is that i have to able to next do this through lan.my approach was to use a webserver "web2py" to do this i have few questions: 1.how do i get web2py to acess data

[web2py] Re: scheduler problem in trunk when using datetime as return value?

2012-12-10 Thread Massimo Di Pierro
I think we should use gluon.serializers.json which handles this case. On Monday, 10 December 2012 09:12:04 UTC-6, Niphlod wrote: > > this is "normal": the json serializer by default doesn't handle datetime > objects serialization. > > Python 2.7.3 (default, Apr 10 2012, 23:31:26) > Type "help",

Re: [web2py] Re: Should I restart nginx when routes.py changes?

2012-12-10 Thread Vinicius Assef
Thank you Jonathan and Niphlod. I'm working with routes and trying to normalize things to have just one version of myapp/routes.py running local and in test/production environment. Here is a pastebin with questions. Could you help me? -- Vinicius Assef On Mon, Dec 10, 2012 at 1:15 PM, Niphlod

[web2py] Re: recursive error when including sidebar view

2012-12-10 Thread Anthony
and in layout.html: > > > {{if left_sidebar_enabled:}} > > > > > > {{include 'sidebar.html'}} > In layout.html you include sidebar.html, but then in sidebar.html, you extend layout.html. So, when layout.html includes sidebar.html, it then extends itself, which

[web2py] Re: high availability

2012-12-10 Thread Massimo Di Pierro
Looks like a nice project. It is not clear to me why it should be integrated with web2py. It looks ortogonal to it. You can use with it as middleware but web2py needs to knowledge of it. Am I missing something? On Monday, 10 December 2012 00:43:26 UTC-6, Oli wrote: > > could this be a part of w2

[web2py] Re: problem importing dbconnection - works on first request after server start then shows zero rows

2012-12-10 Thread Massimo Di Pierro
You cannot do this. The connection has to be stablished in the models and the tables have to be defined in the models as well. The issue is that a db connection only lives within a thread. Since web2py is multithreaded at every request you may get a different thread. If is ok to do import oca

[web2py] Re: Code changes not honored (by web2py?)

2012-12-10 Thread Massimo Di Pierro
It should work when you do it. Which python version? Which web2py version? On Monday, 10 December 2012 02:57:20 UTC-6, Chr_M wrote: > > I call this function at the top of my db.py model file. Is this not the > correct location? > > Regards, Chris > > > On Sunday, December 9, 2012 11:55:06 PM UTC

[web2py] Re: impersonate broken

2012-12-10 Thread Massimo Di Pierro
This does not look at all related with the topic of the thread. It also looks like that you are using eclipse+pydev and you get an error in import socket.py from Python2.5 and socket is a system library. Can you start web2py in the normal way? On Sunday, 9 December 2012 23:57:07 UTC-6, weheh wr

[web2py] Re: New use for detect_record_change=True?

2012-12-10 Thread Massimo Di Pierro
If the form does not contain this is possible. Perhaps something like this? var ser_form = null; jQuery(function() { var myform = Query('form'); ser_form = myform.serialize(); myform.submit(function() { if(ser_form == myform.serialize()) { alert('form no

[web2py] Re: no such column: content.id

2012-12-10 Thread Niphlod
I think that the problem is this: db.comment.content_id.default = db.content.id You can't set a default value that is a Field (as db.sometable.somefield). Seeing the code it may be a bug: you probably meant db.comment.content_id.default = content.id Can you try to remove t

[web2py] Re: problem with latest trunk SQLFORM.grid

2012-12-10 Thread Massimo Di Pierro
Are you logged in when you try accessing the grid? Do you get a not authorized when trying to visualize the grid or when searching or when visualizing a record? Massimo On Sunday, 9 December 2012 19:23:20 UTC-6, tomt wrote: > > Hi, > > Recent changes in trunk are causing my use of SQLFORM.grid

Re: [web2py] Re: "Duplicate headers received from server" on Google Chrome

2012-12-10 Thread Niphlod
This patch https://github.com/web2py/web2py/commit/5e7de996e023a21247d4a9b05a55755d42478895 shows that it's fixed already. On Monday, December 10, 2012 12:59:30 PM UTC+1, Mandar Vaze wrote: > > Sorry it me so long to test this. > > > could you try opening globals and around line 400 replace wi

[web2py] Re: recursive error when including sidebar view

2012-12-10 Thread jonas
in order to simplify the problem I created a simple layout.html with only one include directive: template span4 span8 span10 {{include}} {{pass}} span2 and an equal simple index.html: {{extend 'layout.html'}} {{

Re: [web2py] Re: Should I restart nginx when routes.py changes?

2012-12-10 Thread Niphlod
confirming: in multiprocess environments reload routes is unuseful (and "right" to be so) cause it affects only the process "processing" the request. After all, in production environments routes can't change so often. Reloading e.g. uwsgi is a breeze both with signals and with options like touc

[web2py] Re: scheduler problem in trunk when using datetime as return value?

2012-12-10 Thread Niphlod
this is "normal": the json serializer by default doesn't handle datetime objects serialization. Python 2.7.3 (default, Apr 10 2012, 23:31:26) Type "help", "copyright", "credits" or "license" for more information. >>> import json >>> import datetime >>> json.dumps(datetime.datetime.now()) Traceba

[web2py] scheduler problem in trunk when using datetime as return value?

2012-12-10 Thread Rene Dohmen
Hi, I like the new scheduler concept a lot. It looks promising. Something goes wrong when I try to return a datetime in the method I wanted to schedule... A Simple JSON parsing error -- raise TypeError(repr(o) + " is not JSON serializable") TypeError: datetime.datetime(2012, 12, 10, 15, 57, 59, 3

Re: [web2py] Re: Should I restart nginx when routes.py changes?

2012-12-10 Thread Jonathan Lundell
On 10 Dec 2012, at 6:30 AM, Vinicius Assef wrote: > > So, in production environment, the "reload routes" button is useless? It depends on your server configuration, I suppose, but in the general case I think it might be. Unless I'm missing something. > > > On Mon, Dec 10, 2012 at 12:22 PM, J

Re: [web2py] Re: Should I restart nginx when routes.py changes?

2012-12-10 Thread Vinicius Assef
So, in production environment, the "reload routes" button is useless? On Mon, Dec 10, 2012 at 12:22 PM, Jonathan Lundell wrote: > On 10 Dec 2012, at 4:33 AM, Vinicius Assef wrote: >> >> Actually, I needed to restart uwsgi, not nginx. > > The reload routes button is insufficient when you're runn

Re: [web2py] Re: Should I restart nginx when routes.py changes?

2012-12-10 Thread Jonathan Lundell
On 10 Dec 2012, at 4:33 AM, Vinicius Assef wrote: > > Actually, I needed to restart uwsgi, not nginx. The reload routes button is insufficient when you're running in a multiprocess (vs single-process multithreaded) environment, because only one process sees the button press. > > > > On Mon

[web2py] Re: I do not use cache, but the system cache throws me errors .. : S

2012-12-10 Thread www.diazluis.com
def planilla(): id_user = (auth.user and auth.user.id) or None plugin_inscripcion_temp_id = request.args[0] plugin_inscripcion_temp = db.plugin_inscripcion_temp(id=plugin_inscripcion_temp_id, user=id_user) if plugin_inscripcion_temp is None: session.flash = 'Error pro

[web2py] Re: Should I restart nginx when routes.py changes?

2012-12-10 Thread Vinicius Assef
Actually, I needed to restart uwsgi, not nginx. On Mon, Dec 10, 2012 at 10:29 AM, Vinicius Assef wrote: > I created a routes.py script in web2py root with only this line: > default_application = 'myapp' > > Then, I clicked "reload routes" button in the admin app, but no effect > take place. > >

[web2py] Should I restart nginx when routes.py changes?

2012-12-10 Thread Vinicius Assef
I created a routes.py script in web2py root with only this line: default_application = 'myapp' Then, I clicked "reload routes" button in the admin app, but no effect take place. Things just worked out when I restarted nginx via command line. It it supposed to work this way? Should I really resta

Re: [web2py] Re: "Duplicate headers received from server" on Google Chrome

2012-12-10 Thread Mandar Vaze / मंदार वझे
Sorry it me so long to test this. > could you try opening globals and around line 400 replace with this ? (just > the quotation marks added) > > headers['Content-Disposition'] = \ > 'attachment; filename="%s"' % filename > > If the error goes away we can patch other few places usin

[web2py] Re: Subfolders in models

2012-12-10 Thread Joel Samuelsson
I've been testing the way you described above and it works, to a point. The models are not imported in alphabetical order. This seems to be controlled by this line (521): models = listdir(path, '^\w+\.py$', 0, sort=False) in compileapp.py listdir is essentially os.walk with a regexp for filtering

[web2py] recursive error when including sidebar view

2012-12-10 Thread jonas
HI I have two views that I want to have in the same layout file. One is for the sidebar and the other one is for the main column. sidebar.html: {{extend 'layout.html'}} index.html: {{extend 'layout,html'}} and in layout.html: {{if left_sidebar_enabled:}}

Re: [web2py] high availability

2012-12-10 Thread Michele Comitini
+1 I wonder if the following would work "It can also be used to aim an app that was written to use PostgreSQL at a different database." http://sqlrelay.sourceforge.net/sqlrelay/dropin/postgresql.html 2012/12/10 Oli > could this be a part of w2p. > > http://sqlrelay.sourceforge.net/documentat

[web2py] problem importing dbconnection - works on first request after server start then shows zero rows

2012-12-10 Thread simon
In my model file I am importing a database definition from a module file. This works correctly the first time after the server is started showing the tablename and 11 rows in the table. However for the second and subsequent requests it shows a rows object but 0 rows in the table. It works fine if

[web2py] Re: Code changes not honored (by web2py?)

2012-12-10 Thread Chr_M
No, I am not using Ajax callbacks. I have done some more research, but I could be a Python thing as well. http://stackoverflow.com/questions/437589/how-do-i-unload-reload-a-python-module http://stackoverflow.com/questions/2918898/prevent-python-from-caching-the-imported-modules The common most

[web2py] no such column: content.id

2012-12-10 Thread sasogeek
I stumbled upon this error while trying to submit a form in my app. here's the code related to the database table "content" ### # # # # # # # Model # # # # # # ### db.define_table('content', Field('title', unique=True), Fiel

[web2py] Re: Code changes not honored (by web2py?)

2012-12-10 Thread Lazarof
Hi! Are you using Ajax callback funcion? понедельник, 10 декабря 2012 г., 1:34:09 UTC+4 пользователь Chr_M написал: > > Sometimes the changes in the code of a module (in the modules directory) > are not working when requesting the url that uses these modules. in the > modules directory I have

[web2py] Re: Code changes not honored (by web2py?)

2012-12-10 Thread Chr_M
I call this function at the top of my db.py model file. Is this not the correct location? Regards, Chris On Sunday, December 9, 2012 11:55:06 PM UTC+1, Massimo Di Pierro wrote: > > This has come up before. > > from gluon.custom_import import track_changes; track_changes() > > must be a model fi