[web2py] Re: Scheduler compatible with nginx/uwsgi?

2013-06-16 Thread Joe Barnhart
Good points. But since I'm running the same application in the web server, and it can see and read/write the PostgreSQL database from the web process, does that imply that the scheduler process (which uses all the same files) can see the database as well? If there is nu such assumption, how

[web2py] KeyError: 1L in hash table

2013-06-16 Thread Jayakumar Bellie
I have to create a has table like { '1':'data1', '2':'data2', '10':'data3', '50':'data4' } I get the data from the database, here is the code where I format the data 1dataTypeList = {} 2for row in result: 3 dataTypeList[row.number_indicator] = dataTypeList[row.data] I

[web2py] Re: Spammers on web2pyslices.com

2013-06-16 Thread Joe Barnhart
At least one site i use regularly implemented a 24-hour posting delay. Sign up today and your posting ability starts tomorrow. It was a little annoying to newbies but it really zeroed the spam! -- Joe On Saturday, June 15, 2013 12:40:50 PM UTC+8, rochacbruno wrote: Hi, recently we are

[web2py] Re: Removing Foreign Key constraint?

2013-06-16 Thread Massimo Di Pierro
This should now be fixed in trunk. Please check it. On Thursday, 6 June 2013 08:19:35 UTC-5, Lamps902 wrote: To clarify, due to the SQL Foreign Key constraint (which is retained when archive tables are created through auth.enable_record_versioning), some of the archive database's tables

Re: [web2py] Re: admin access password file

2013-06-16 Thread Massimo Di Pierro
After uwsgi_param UWSGI_SCHEME $scheme; you must add uwsgi_param HTTP_X_FORWARDED_PROTO https; On Wednesday, 12 June 2013 09:09:01 UTC-5, Paolo valleri wrote: Hi Massimo, I used https. I expired the same behavior on both apache and nginx. please find attached the condiguration

[web2py] Re: How to use shell with GAE dev server

2013-06-16 Thread Massimo Di Pierro
Please open a ticket. This is supposed to work, with quirks, but it should work. On Wednesday, 12 June 2013 12:20:16 UTC-5, Quint wrote: Hello, I'm trying to use the interactive shell with the GAE dev server on Windows. Wahet do i need to do to getthis working? I'm now getting this error

[web2py] Re: Fields being set to NULL on SQLFORM.grid update

2013-06-16 Thread Massimo Di Pierro
The problem is that the grid expects the field to be writable in the form. You do not include them therefore it thinks they are empty (html convention, not web2py's). Assuming you want the fields in the create form but not in the edit form you can replace: grid =

Re: [web2py] PostgreSQL problem

2013-06-16 Thread Arnon Marcus
Done. https://code.google.com/p/web2py/issues/detail?id=1535 https://code.google.com/p/web2py/issues/detail?id=1536 Just so you know... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving

[web2py] Re: help testing auth.signature with mysql/pgsql

2013-06-16 Thread Arnon Marcus
That's not a justified reason. If I have a table with a column that has zero nulls in it, it is perfectly reasonable for me to expect to be able to add a not-null constraint after the fact. If web2py is dealing with this migration, it should at least attempt to do it correctly. It should only

Re: [web2py] Re: Spammers on web2pyslices.com

2013-06-16 Thread Michele Comitini
As an alternative method there is a very robust solution: client auth using a x509 client certificate. As a user installing the certificate is simpler than answering questions or reading weird captchas and he can forget about it, the browser does all the auth by itself using the SSL/TLS protocol,

Re: [web2py] Re: Spammers on web2pyslices.com

2013-06-16 Thread Niphlod
@mcm: apart from explaining a user how to set his browser to provide client auth with ssl, I don't think that pyhonaywhere lets you use client-side ssl auth. @joe: talking about annoy, a 24 hour stop would surely make me angry. The problem here is stop bots, with this you have to manually

[web2py] Re: KeyError: 1L in hash table

2013-06-16 Thread Niphlod
how do you expect to run such code in a python environment ? the first loop of that cycle tries to create a key within an empty dictionary with a value from an empty dictionary it's going to fail every time if row.data isn't in the dictionary yet. On Sunday, June 16, 2013 9:51:15 AM UTC+2,

[web2py] Re: Scheduler compatible with nginx/uwsgi?

2013-06-16 Thread Niphlod
never run the scheduler with sqlite database, if you're planning to launch multiple schedulers. SQLite and concurrency don't go along very well. If your app accesses the postgresql database it should be able to connect as well from the scheduler, it's true, but evidently something is different

[web2py] Re: KeyError: 1L in hash table

2013-06-16 Thread Anthony
Perhaps you meant to do: dataTypeList[row.number_indicator] = row.data Anthony On Sunday, June 16, 2013 3:51:15 AM UTC-4, Jayakumar Bellie wrote: I have to create a has table like { '1':'data1', '2':'data2', '10':'data3', '50':'data4' } I get the data from the database, here is the

[web2py] Re: KeyError: 1L in hash table

2013-06-16 Thread Jayakumar Bellie
It is a mistake made my me I dont know how did I miss it, very bad. dataTypeList[row.number_indicator] = dataTypeList[row.data] it should be dataTypeList[row.number_indicator] = row.data On Sunday, June 16, 2013 1:21:15 PM UTC+5:30, Jayakumar Bellie wrote: I have to create a has table like

[web2py] Noob Help - Starting from scratch

2013-06-16 Thread Alessandro Piroddi
Hi :) I guess this kind of post comes up a lot, but I tryed searching the group and I still have problems... so I'm trying to ask a direct question. I hope you won't mind ^__^ I am no programmer. I know a bit my way around HTML and CSS, had (long time ago) an idea on how to use Javascript. I'm

[web2py] Re: Noob Help - Starting from scratch

2013-06-16 Thread Anthony
If you're completely new to web programming (particularly with an MVC framework), I would strongly suggest going through at least the Introductionhttp://web2py.com/books/default/chapter/29/01 (particularly the MVChttp://web2py.com/books/default/chapter/29/01#Model-View-Controllersection) and

[web2py] Re: Noob Help - Starting from scratch

2013-06-16 Thread Anthony
One more thing to keep in mind. With an MVC framework like web2py, it is important to understand that URL's do not refer directly to individual HTML pages in directories on the server (as they might with a static site). Rather, a URL is a route to a function in a controller, and that function

[web2py] How to install web2py source code in windows 7? with python27.4 already installed

2013-06-16 Thread Marco Ippolito
Hi everybody, before I installed the binary version of web2py but didn't manage to make it starting as windows service. So I decided to install the source version of web2py. I extracted web2py_src file in C:\ Following the instructions on web2y site To run from source, type: python2.5

[web2py] Re: How to install web2py source code in windows 7? with python27.4 already installed

2013-06-16 Thread Niphlod
do you have python installed ? Source distribution means that you have a python environment available on your computer From then on (usually on windows the python installation path is c:\python2.7 ) you just do cd c:\where_web2py_is_extracted\ c:\python2.7\python.exe web2py.py On Sunday,

[web2py] Re: Noob Help - Starting from scratch

2013-06-16 Thread Alan Etkin
Any pointers? Just in case Anthony info missed it: http://www.youtube.com/watch?v=M5IPlMe83yI Massimo covers some framework features and the second part shows how to build an app from scratch. AFAIK the coolest/updated video on web2py. -- --- You received this message because you are

[web2py] Re: How to install web2py source code in windows 7? with python27.4 already installed

2013-06-16 Thread Anthony
You don't start web2py from a Python shell -- instead, open a command prompt and do: cd path\to\web2py python web2py.py Make sure you have pywin32 http://sourceforge.net/projects/pywin32/installed. Also, you may need to create a PYTHONPATH environment variable and add your web2py folder

[web2py] how to auto update embedded components upon submitting a form?

2013-06-16 Thread step
In the same page I placed three embedded components, each one with its own separate .load file which index.html loads with LOAD(). 1) form_years, SQLFORM.factory whose controller returns dict(form_years=form_years) 2) grid_course, SQLFORM.grid whose controller returns

[web2py] Re: How to install web2py source code in windows 7? with python27.4 already installed

2013-06-16 Thread Marco Ippolito
Il giorno domenica 16 giugno 2013 15:49:43 UTC+2, Marco Ippolito ha scritto: Hi everybody, before I installed the binary version of web2py but didn't manage to make it starting as windows service. So I decided to install the source version of web2py. I extracted web2py_src file in C:\

[web2py] Re: How to install web2py source code in windows 7? with python27.4 already installed

2013-06-16 Thread Anthony
You should also add the Python folders to your PATH environment variable -- something like: C:\Python27\;C:\Python27\Scripts Anthony On Sunday, June 16, 2013 11:40:38 AM UTC-4, Marco Ippolito wrote: Hi Anthony, thank you for your kind help pywin32 installed, as you can see from the pdf

[web2py] Re: How to install web2py source code in windows 7? with python27.4 already installed

2013-06-16 Thread Marco Ippolito
Hi Anthony, thank you very much for your kind help. Is there somewhere a step-by-step procedure for someone like me, at its beginnig of his journey? I added in the PATH environment variable all folders path but it still doesn't work Marco Il giorno domenica 16 giugno 2013 19:10:03 UTC+2,

[web2py] DAL has no attribute...

2013-06-16 Thread lesssugar
Hi. I define table 'vessel' in one of my models: db.define_table('vessel', Field('name', length = 128, label='Vessel type'), format=lambda r: r.name ) The table was created (checked it in sql.log). However, when I try to reference the table in another one (in another model) like this: ...

Re: [web2py] DAL has no attribute...

2013-06-16 Thread Marin Pranjić
It is possible if second define is called before the first one. Models are sorted alphabetically. Make sure vessel ia defined before the other table. Marin (mobile) On Jun 16, 2013 7:53 PM, lesssugar rgozdzial...@gmail.com wrote: Hi. I define table 'vessel' in one of my models:

Re: [web2py] DAL has no attribute...

2013-06-16 Thread lesssugar
Yep, that was it. Thanks. On Sunday, June 16, 2013 8:14:41 PM UTC+2, Marin Pranjić wrote: It is possible if second define is called before the first one. Models are sorted alphabetically. Make sure vessel ia defined before the other table. Marin (mobile) On Jun 16, 2013 7:53 PM, lesssugar

[web2py] Re: How to install web2py source code in windows 7? with python27.4 already installed

2013-06-16 Thread Anthony
Are you able to run any Python scripts on your machine (i.e., python somescript.py)? If not, the problem is not web2py specific, and I would suggest looking for tutorials for setting up Python on Windows. Anthony On Sunday, June 16, 2013 1:53:22 PM UTC-4, Marco Ippolito wrote: Hi Anthony,

[web2py] Re: how to auto update embedded components upon submitting a form?

2013-06-16 Thread Massimo Di Pierro
The code in ### # RELOAD COMPONENTS grid_course AND grid_pricelist BUT HOW? ### should be response.js = jQuery('#grid_course,#grid_pricelist').reload() could it be easier? On Sunday, 16 June 2013 09:59:06 UTC-5, step wrote: In the same

[web2py] Re: about web2py and this mailing list

2013-06-16 Thread Arjit Yadav
Hey friends, I am new to python and i love coding in python (basics). I want to become a good coder in python and report bugs and help others. How should i go about doing that ? Please help as i am a beginner. Regards On Saturday, 5 December 2009 01:45:50 UTC+5:30, mdipierro wrote: I have

[web2py] Re: how to auto update embedded components upon submitting a form?

2013-06-16 Thread step
It couldn't be any easier! Luv that web2py. Honestly, I had gotten very close to the right answer. My code was using response.js='location.reload();' as a temp workaround for my inability to reload just the components. But I didn't make the connection that I should drill down into the DOM from

Re: [web2py] Re: Fields being set to NULL on SQLFORM.grid update

2013-06-16 Thread Jim Steil
I was hoping I wouldn't have to do that but I understand. I think it should be pointed out in the manual that this needs to be done so others don't make the same mistake I did. Thanks Massimo, I really appreciate the reply. Jim On Jun 16, 2013 3:41 AM, Massimo Di Pierro

[web2py] Re: how to auto update embedded components upon submitting a form?

2013-06-16 Thread Massimo Di Pierro
It is possible there is a bug. Can you check you have a recent static/js/web2py.js. It should contain these lines: function web2py_component(action, target, timeout, times){ jQuery(function(){ var jelement = jQuery(# + target); var element = jelement.get(0); var statement =

Re: [web2py] Re: Fields being set to NULL on SQLFORM.grid update

2013-06-16 Thread Massimo Di Pierro
How do you think it should work? If we can make it better we will. On Sunday, 16 June 2013 15:02:28 UTC-5, Jim S wrote: I was hoping I wouldn't have to do that but I understand. I think it should be pointed out in the manual that this needs to be done so others don't make the same mistake

[web2py] Re: how to auto update embedded components upon submitting a form?

2013-06-16 Thread step
OK, this works js = '' for x in [grid_course,grid_pricelist]: js += $('#+x+').load('/+/.join([request.application, request. controller])+/+x+.load'); response.js = js or the equivalent, but more cryptic ;.join($('#+x+').load('/+/.join([request.application, request. controller])+/+x+.load')

[web2py] Re: how to auto update embedded components upon submitting a form?

2013-06-16 Thread step
I will check but I doubt it's a bug, jQuery doesn't have a reload function, js does. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [web2py] Re: Fields being set to NULL on SQLFORM.grid update

2013-06-16 Thread Jim Steil
I thought I could just use whatever fields I wanted and it would figure out which ones to update. The way it is now, if I add a field to a table and it isn't included in the writable = False statements the It is going to be set to null on any future updates. I would prefer to not have to worry

Re: [web2py] Re: about web2py and this mailing list

2013-06-16 Thread samuel bonilla
read a lot code and write a lot code github is a great place for learn... look this books http://it-ebooks.info/search/?q=pythontype=title 2013/6/16 Arjit Yadav arjit32...@gmail.com Hey friends, I am new to python and i love coding in python (basics). I want to become a good coder in

Re: [web2py] Re: about web2py and this mailing list

2013-06-16 Thread samuel bonilla
read code and write code https://github.com/languages/Python 2013/6/16 samuel bonilla pythonn...@gmail.com read a lot code and write a lot code github is a great place for learn... look this books http://it-ebooks.info/search/?q=pythontype=title 2013/6/16 Arjit Yadav

[web2py] Re: how to auto update embedded components upon submitting a form?

2013-06-16 Thread step
I do have that function. Maybe that function itself is giving me a clue, on the fifth line var statement = jQuery('# + target + ').get(0).reload();; so adding .get(0) after jQuery() enables reload(), of course... On Sunday, June 16, 2013 10:34:28 PM UTC+2, step wrote: I will check but I

Re: [web2py] Re: Spammers on web2pyslices.com

2013-06-16 Thread villas
I think that honeypot + timestamp + js execution are transparent to the end user and keep the vast majority of bots out. Yes that sounds very good. Re: Honeypot. As already mentioned, a display:none input box on its own does not seem to defeat spammers these days. However, there could be

[web2py] Re: how to auto update embedded components upon submitting a form?

2013-06-16 Thread step
Yes, this works too response.js = $('#grid_course').get(0).reload();$('#grid_pricelist').get(0).reload() On Sunday, June 16, 2013 10:41:26 PM UTC+2, step wrote: I do have that function. Maybe that function itself is giving me a clue, on the fifth line var statement = jQuery('# + target +

[web2py] Re: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-16 Thread villas
I'm not sure, but... you may be describing a requirement for cascading selects? If so, search for cascading on this group and web2pyslices.com. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop

[web2py] Drop-down auto populate not working

2013-06-16 Thread lesssugar
I need to auto-populate my 'ranks' drop-down based on the value selected in the 'department' one. This is my script: script $(#department).change(function() { $(#ranks).load(?dpt= + $(#department).val()); }); /script As you can see, I pass *dpt *var to my current function. This is it's code:

[web2py] Re: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-16 Thread Anthony
I am trying to have a form with three fields, the first one needs to to validated against data base (this can be done in the controller by field1.requires = IS_IN_DB(...)) , the second one needs to be validated against data base and the entered value of field1 ( field2.requires =

[web2py] Re: Drop-down auto populate not working

2013-06-16 Thread villas
Hmm I'm not sure you have given enough info. Anyhow: Check in Firebug whether the load function is being triggered. Place print statements in your function to test that the variables are being set. Bear in mind that return dict(...) will render a complete page layout. I wonder if that is

[web2py] Re: Padding Error...

2013-06-16 Thread Auden RovelleQuartz
More Information: It seems that this error occurs when using PostgreSQL - when using the native SQLite database, it does not happen... The file seems to be OK (as in not corrupted) because for both cases (PostgreSQL and SQLite) I am using the same png images -- --- You received this

[web2py] Re: how to auto update embedded components upon submitting a form?

2013-06-16 Thread Anthony
Yes, it's better to use .reload() rather than .load(), as that will call the .web2py_ajax_page() function and load it as a component instead of just using a standard ajax request. Another option is: response.js = 'web2py_component(%s, grid_course); web2py_component(%s, grid_pricelist);' % \

[web2py] Re: Drop-down auto populate not working

2013-06-16 Thread lesssugar
Yes, I checked: the load function is being triggered and *dpt* variable is being set in the function every time I select an option from the first drop-down. Changed the function so it uses OPTION helper: def add_experience(): add_experience = crud.create(db.seafarer_experience,

[web2py] Re: http://web2py.com/plugins is broken

2013-06-16 Thread Oleg
:) sorry for annoyance.. is any news about it? On Tuesday, 11 June 2013 04:40:04 UTC+2, Massimo Di Pierro wrote: I agree there is a problem. For now I have disabled it. I will check tomorrow. I think it is a caching issue. On Monday, 10 June 2013 17:13:21 UTC-5, Oleg wrote: does anybody

[web2py] Re: Drop-down auto populate not working

2013-06-16 Thread lesssugar
Furthermore... strange. If I print the request.vars.dpt somewhere in the 'add_experience' function, the value is printed every time I select an option n the first drop-down. However, If I just want to return this: ranks = db(db.rank.department_id == request.vars.dpt).select(orderby=db.rank

[web2py] Re: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-16 Thread Auden RovelleQuartz
Here is an application that does that: https://w2p001.pythonanywhere.com/selection/default/index *here is the Model (db.py):* *db = DAL('sqlite://storage.sqlite')* * * * * *db.define_table(metals,* *Field(choice),* *)* *here is the Controller (default.py):* * * *def index():* *

[web2py] Using a python module in web2py

2013-06-16 Thread Joe Magaro
Hi, I have a thesaurus(nltk-wordnet) working from the python command line. However when I try to use it in Web2Py I get an error. Can someone help, please --- all the details are Below: Simple example Code: - import nltk from nltk.corpus import wordnet as wn

[web2py] Tracebak Pythonanywhere

2013-06-16 Thread Ovidio Marinho
I'm having trouble creating the database in MySQL in pythonanywhere the error is this: Error ticket for plantaotccTicket ID 177.158.224.217.2013-06-17.01-44-42.a6cbbaa6-02f4-44cd-b883-4f98a52c1102 type 'exceptions.RuntimeError' Failure to connect, tried 5 times: Traceback (most recent call

[web2py] Re: Tracebak Pythonanywhere

2013-06-16 Thread Ovidio Marinho
parece que neste topico antigo do massimo ele fala em driver que precisa instalar manualmente, isto ainda nao foi corrigido? To use mysql you need to run from source and install the MySQLdb driver since I am not allowed to distriute the driver with web2py. Sorry. Massimo -On Apr 30, 2008, at

[web2py] Re: Tracebak Pythonanywhere

2013-06-16 Thread Ovidio Marinho
it seems that this topic ancient massimo he speaks in you need to install driver manually, it still was not fixed? To use mysql you need to run from source and install the MySQLdb driver since I am not allowed to distriute the driver with web2py. Sorry. Massimo On Apr 30, 2008, at 12:12 PM,

Re: [web2py] Re: Fields being set to NULL on SQLFORM.grid update

2013-06-16 Thread Massimo Di Pierro
I am afraid this is not possible because HTML cannot distinguish an empty submission from no submission. Somehow we have to tell that explicitly to web2py. Perhaps there is a better way to do it but I do not see on. :-( On Sunday, 16 June 2013 15:35:27 UTC-5, Jim S wrote: I thought I could

[web2py] Re: how to auto update embedded components upon submitting a form?

2013-06-16 Thread Massimo Di Pierro
I think this should be changed... The get(0) should not be required. We can change web2py.js. On Sunday, 16 June 2013 15:47:09 UTC-5, step wrote: Yes, this works too response.js = $('#grid_course').get(0).reload();$('#grid_pricelist').get(0).reload() On Sunday, June 16, 2013 10:41:26 PM