[web2py] Re: SQLFORM hanging on insert

2015-01-30 Thread Ian W. Scott
Thanks for the suggestion Niphlod. I'm just not sure what you mean by start a shell. Can you explain? Ian On Thursday, January 29, 2015 at 4:28:15 PM UTC-5, Niphlod wrote: what about if you start a shell and issue the insert statement with a db.commit() ? does it hang also there ? On

Re: [web2py] Dal tip . table to store upload from more than one table ?

2015-01-30 Thread Michele Comitini
There are many ways to do this and your way is not wrong in my POV. You could have used table inheritance see: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Table-inheritance If you want for some reason to have all uploaded files references in one table you can do

[web2py] Re: web2py 2.9.12 is OUT

2015-01-30 Thread Cynthia Butler
Here's how the update worked for me: - I was on version 2.9.11 (ubuntu 14.04, nginx, uwsgi, mongodb) - I used the update button on the admin panel. - It updated most of the files, then stopped with a message that there was no DAL folder with an __init__ file. - So I created them

[web2py] Re: web2py 2.9.12 is OUT

2015-01-30 Thread Antonio Salazar
I managed to find the cause of the bug. The editor fails if web2py's path has non-standard characters. - Works correctly if installed on *c:\banana\web2py* - Editor save hangs on syntax errors if installed on *c:\plátano\web2py* I'll create the github ticket as soon as possible. El jueves, 29

[web2py] Dal tip . table to store upload from more than one table ?

2015-01-30 Thread António Ramos
Hello i have an app with table A and B Each record in A and B can have many upload files so i created table C and D respectively just to collect upload files from A and B This is my table C and D (they are equal) db.define_table('C_files', Field('f_emp_ref', db.A, notnull=True,

[web2py] Re: TR and CAT

2015-01-30 Thread Leonel Câmara
Humm CAT is specifically an exception to this, here's the code: if isinstance(c, (allowed_parents,CAT)): pass In the case of TR allowed_parents is (TD, TH) but CAT is always exempt no matter what tag is doing the wrapping. I'm guessing the reason is that you can't know if the CAT will

Re: [web2py] Why does redirect() always append '#'?

2015-01-30 Thread Richard Vézina
I should had try... :( I thought about it... what you think about the back shalsh? Richard On Thu, Jan 29, 2015 at 4:57 PM, Anthony abasta...@gmail.com wrote: SQLFORM(..., _action='') SQLFORM.factory(..., _action='') The above are both just HTML helpers, so you can add any attribute as

Re: [web2py] Why does redirect() always append '#'?

2015-01-30 Thread Richard Vézina
Bad idea, it trunk the redirect completly :D Richard On Fri, Jan 30, 2015 at 11:36 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: I should had try... :( I thought about it... what you think about the back shalsh? Richard On Thu, Jan 29, 2015 at 4:57 PM, Anthony

[web2py] Re: SQLFORM hanging on insert

2015-01-30 Thread Ian W. Scott
If it helps at all, here's the controller function that creates and processes the form: def dupAndEdit(): Create and process a form to insert a new record, pre-populated with field values copied from an existing record. tablename = request.args[0] rowid = request.args[1]

[web2py] Re: Run web2py in public IP without explicit IP address - linux

2015-01-30 Thread Niphlod
why don't you just use 0.0.0.0 ? On Friday, January 30, 2015 at 2:43:02 PM UTC+1, Aydin S wrote: Hi, i tried to run web2py from public IP in linux like this: web2py -i hostname -a pass It did not work. I realized it was due to using hostname; it works fine when doing web2py -i

[web2py] Re: Submit current form prior to logout?

2015-01-30 Thread Niphlod
the gist of it should be something like $(function() { $('a#thelogoutbutton').on('click', function(e) { e.preventDefault(); if (code_to_submit_the_form() == 'everythingwentwell') { window.href = this.href; } else { managefailure();

[web2py] Re: Groupby year on date field

2015-01-30 Thread Niphlod
https://lh6.googleusercontent.com/-pWsAPTKJbZ8/VMv7E7GHWnI/ARs/OMWXe-Ku54c/s1600/counts.png are you sure that the issue is not fetching but rather visualizing the results you already fetched ??? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Run web2py in public IP without explicit IP address - linux

2015-01-30 Thread Aydin S
Thanks for the reply. 0.0.0.0 makes the server run in 127.0.0.1 which is local and does not give me access to the website from other computer. sexta-feira, 30 de Janeiro de 2015 às 10:46:05 UTC-5, Niphlod escreveu: why don't you just use 0.0.0.0 ? On Friday, January 30, 2015 at 2:43:02 PM

[web2py] Re: SQLFORM hanging on insert

2015-01-30 Thread Michele Comitini
Why do you commit? not needed and even dangerous in that position. What db are you using? Do as niphlod suggests: python web2py.py -M -S here the name of your application At the prompt issue: [1] db.commit() does it stall? Il giorno venerdì 30 gennaio 2015 18:10:23 UTC+1, Ian W. Scott

[web2py] Re: How can I change a form so that the Enter key is disabled for Submit

2015-01-30 Thread Niphlod
there are a lot if you want to do down that path. http://stackoverflow.com/questions/895171/prevent-users-from-submitting-form-by-hitting-enter IMHO disabling enter is not a solution (I'm a keyboard guy and I love to send forms with enter): at the very minimum you should do a proper validation

[web2py] Re: Groupby year on date field

2015-01-30 Thread Niphlod
it works perfectly fine! On Friday, January 30, 2015 at 5:10:46 AM UTC+1, Moiz Nagpurwala wrote: Thanks Niphlod for the replies. The code you provided does not seem to work for me. I tried the attached app on my local machine with SQLITE as well as MySQL on PythonAnywhere

[web2py] Re: Question about web2py roadmap.

2015-01-30 Thread Leonel Câmara
I strongly agree with Massimo on this. By making administrative tasks easier you take that burden out of many developers. Not every developer is part of a big team that has one guy just to take care of administrative stuff. This is very true in the startup market where I think web2py has an

[web2py] Re: SQLFORM hanging on insert

2015-01-30 Thread Ian W. Scott
Thanks, Michelle, for spelling out what Niphlod meant about the shell. Ignore the db.commit() in the controller code. That was something I threw in briefly to see what would happen. I forgot to remove it. When I do db.commit() from the interactive prompt it doesn't hang or stall. I'm using

[web2py] Global name 'crud' is not defined

2015-01-30 Thread Manuel Moscariello
Hello everybody, this is my first post here, I'm right now in the study phase of web2py, getting pretty enthusiast about it. I was following a tutorial I found on a discussion of this group, http://killer-web-development.com . Now, at a stage I should append to my controllers/default.py: def

[web2py] How can I change a form so that the Enter key is disabled for Submit

2015-01-30 Thread Tom Stratton
I'm finding that a lot of users are hitting Enter instead of Tab and I'm getting half-filled-in forms. I'd like to set the button to NOT default but not sure where to go about making that change. Anyone have a solution? Thanks Tom -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Submit current form prior to logout?

2015-01-30 Thread lillian
Thanks for the reply. Let's assume that the action is in fact a click on the logout button/menu item (I've looked into the onbeforeunload event already, ugh.); I'm not quite sure how to intercept the action. Do I need to add a handler to the menu item, have it call form.submit(), do the

[web2py] Re: Extra field in SQLFORM can not be processed()

2015-01-30 Thread Massimo Di Pierro
I think somewhere you your code you redefined db to be a table. On Friday, 30 January 2015 08:12:44 UTC-6, Richard D wrote: According the book I have added a field to a SQLFORM using the following code: form_chg_entity = SQLFORM(db.entity, showid=False, record = session.sif.id,

[web2py] Re: web2py with bootstrap-slider bootstrap-typeahead

2015-01-30 Thread Massimo Di Pierro
Niphlod. Calm down. Everything is going to be fine. ;-) In fact, I almost did not know JS when I started web2py and avoided it as the plague. Today I like it a log. Back to the original question. Assuming we are diagnosing the problem correctly (and Niphlod in my experience is 100% right)

[web2py] Re: web2py 2.9.12 is OUT

2015-01-30 Thread Massimo Di Pierro
Yes. The new dal broke the automatic update process. Sorry. What do do: 1) remove the file dal.py 2) download web2py from the web site (the zip one) and unzip it over the existing web2py. Overwrite any file that you may have. This will restore the new gluon/dal/*.py files. An upgrade to 2.9.13

[web2py] Re: Run web2py in public IP without explicit IP address - linux

2015-01-30 Thread Massimo Di Pierro
This should not be the case. http://stackoverflow.com/questions/20778771/what-is-the-difference-between-0-0-0-0-127-0-0-1-and-localhost On Friday, 30 January 2015 16:30:26 UTC-6, Aydin S wrote: Thanks for the reply. 0.0.0.0 makes the server run in 127.0.0.1 which is local and does not give

[web2py] Re: Global name 'crud' is not defined

2015-01-30 Thread Massimo Di Pierro
We are trying to deprecate crud therefore if you want to use you must define it: from gluon.tools import Crud; crud = Crud(db); Anyway, your code would be better written as: form = SQLFORM(db.post).process() return dict(form=form) On Friday, 30 January 2015 05:23:37 UTC-6, Manuel

[web2py] Re: 2.9.12 app deploy in GAE error

2015-01-30 Thread Massimo Di Pierro
Yes this is a bug. It will be fixed in the next version. On Friday, 30 January 2015 07:39:50 UTC-6, Jacinto Parga wrote: Hello, I deploy an applicaction in GAE with 2.9.11 succesfully but If I try to deploy it with 2.9.12 I get the following ticket: 2015-01-30 14:31:41.094 Unable to

[web2py] Re: Global name 'crud' is not defined

2015-01-30 Thread Anthony
Answered on Stack Overflow: http://stackoverflow.com/a/28238033/440323 On Friday, January 30, 2015 at 6:23:37 AM UTC-5, Manuel Moscariello wrote: Hello everybody, this is my first post here, I'm right now in the study phase of web2py, getting pretty enthusiast about it. I was following a

[web2py] Re: Extra field in SQLFORM can not be processed()

2015-01-30 Thread Anthony
You added a select element with the name conversation to a SQLFORM based on db.entity. Does db.entity include a field named conversation? On Friday, January 30, 2015 at 9:12:44 AM UTC-5, Richard D wrote: According the book I have added a field to a SQLFORM using the following code:

[web2py] Extra field in SQLFORM can not be processed()

2015-01-30 Thread Richard D
According the book I have added a field to a SQLFORM using the following code: form_chg_entity = SQLFORM(db.entity, showid=False, record = session.sif.id, deletable = False, fields= form_fields ) option_conversations = [OPTION(conv.subject, _value=conv.id) for conv in

Re: [web2py] vars=dict(_next= ...) and settings.cas_domains = None

2015-01-30 Thread Anthony
You cannot set auth.settings.cas_domains to None. Instead, you can set it to an empty list: auth.settings.cas_domains = [] Anthony On Friday, January 30, 2015 at 2:16:16 AM UTC-5, Annet wrote: Thank you both for your replies. Thanks for your reply. I am not using CAS, there's this

Re: [web2py] Trying to run web2py from linux, all ports fail

2015-01-30 Thread Michele Comitini
One trick that could somewhat accelerate the release of a port not properly closed by a server is trying to connect to it. for instance: nc 127.0.0.1 8000 and then CTRL-C the trick awakes the network layer that gives a Connection Refused and from then on the port is free again -- Resources: -

Re: [web2py] Trying to run web2py from linux, all ports fail

2015-01-30 Thread Michele Comitini
as root do: # netstat -tanp and see what you get 2015-01-30 5:28 GMT+01:00 Mirko Scavazzin mscavaz...@gmail.com: *TIME_WAIT** is the state that typically ties up the port for several minutes after the process has completed.*The length of the associated timeout varies on different operating

[web2py] Re: Not a question, book suggestion

2015-01-30 Thread Tim Richardson
On Thursday, January 22, 2015 at 8:38:58 AM UTC+11, Otto Domínguez wrote: I read about lazy_tables = True in the book. I used it at once. Then I read about smartgrid. I used it at once. But things did not work well with reference tables. Looking in this group, I became aware that

Re: [web2py] Trying to run web2py from linux, all ports fail

2015-01-30 Thread Aydin S
I did a test, Mirko is right, in linux if web2py is not shut down right it cannot run on any port other than what it initially run with. Other thing was my own error, for public IP I was using -i hostname this did not work. When I put exact IP address number 192.168.0.0 it works. Now the

[web2py] Run web2py in public IP without explicit IP address - linux

2015-01-30 Thread Aydin S
Hi, i tried to run web2py from public IP in linux like this: web2py -i hostname -a pass It did not work. I realized it was due to using hostname; it works fine when doing web2py -i 192.168.0.0(for example) -a pass Is there any way to not enter the IP address every time? I know web2py itself

Re: [web2py] Trying to run web2py from linux, all ports fail

2015-01-30 Thread Aydin S
Thanks for the replies. Mirko, do you mean I should wait for couple of minutes and run web2py and it will work? Michele, here is the results of the netstat -tanp PID/Program name tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN 832/sshd tcp0 0

Re: [web2py] Trying to run web2py from linux, all ports fail

2015-01-30 Thread Aydin S
I found out what makes the root cause and any suggestion to resolve this is very appreciated: If I run the web2py by local IP, it has no problem with any port. But, if I run the web2py from public IP of machine (192.168.0.0 for example) it gives the error above. And this is limited to linux,

[web2py] 2.9.12 app deploy in GAE error

2015-01-30 Thread Jacinto Parga
Hello, I deploy an applicaction in GAE with 2.9.11 succesfully but If I try to deploy it with 2.9.12 I get the following ticket: 2015-01-30 14:31:41.094 Unable to store in FILE: /base/data/home/apps/s~clubatletismosada/2.381882905081239360/applications/CAS/models/db.py Traceback (most

[web2py] Re: serving a zip file

2015-01-30 Thread Yebach
Using parts of your code I have a problem with zip file. It appends text to new file in my zip So first worker has in his ics file his data but second one has his and from previous This is my code cal = Calendar() import zipfile, cStringIO exported_chunks_zip = cStringIO.StringIO()