[web2py] Problems with sessions in multiple windows...

2010-09-21 Thread Jason Brower
Perhaps I was wrong, but I thought that a session was for a perticular browser and not for a particular screen. It seems that the session data is there, but is sometimes lost. It's very weird. I have one window that makes a call to update all the session data every 2 seconds. On another

[web2py] Re: Deploying web2py on linux (Redhat or others) on cpanel or other ways

2010-09-21 Thread Rahul
I have made the changes as suggested by Jonathan - changes e['REMOTE_ADDR'] to e.get('REMOTE_ADDR', 'localhost'), --- now it does not give me the REMOTE_ADDR Error. It shows the below text.. -bash-3.2$ ./dispatch.fcgi WSGIServer: missing FastCGI param REQUEST_METHOD

[web2py] Re: Deploying web2py on linux (Redhat or others) on cpanel or other ways

2010-09-21 Thread Rahul
I have made the changes as suggested by Jonathan - changes e['REMOTE_ADDR'] to e.get('REMOTE_ADDR', 'localhost'), --- now it does not give me the REMOTE_ADDR Error. It shows the below text.. -bash-3.2$ ./dispatch.fcgi WSGIServer: missing FastCGI param REQUEST_METHOD

[web2py] Creating an upload 'queue'/uploading in the background

2010-09-21 Thread scausten
Does anyone have ideas on how to implement an upload 'queue'? Specifically, my site allows users to upload mp3s, but I'd like to defer the uploading of submitted files when a form is submitted so that the user can continue browsing the site while their file uploads in the background. Ideally I'd

[web2py] I need someone's eyes on this!

2010-09-21 Thread bally boy
Ok so this is a little tweaked code of the estore which Massimo posted. The original one works fine, but here I am just adding a table categories :- db.define_table('categories', Field('category',requires=IS_NOT_IN_DB(db,'categories.category')),format='%(category)s')

[web2py] exec from text area...

2010-09-21 Thread Jason (spot) Brower
I have a text area that I can grab the python code from. When I try to run the code how ever, I get the following error: SyntaxError: unexpected EOF while parsing This error only happens if I put a return in the text area. Otherwise it will run a single line just fine. I want to have multiline

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread villas
Try removing display-name=%{GROUP} from that line. i.e. Replace WSGIDaemonProcess web2py user=www-data group=www-data display-name=% {GROUP} With WSGIDaemonProcess web2py user=www-data group=www-data I am not knowledgeable enough to know whether this has any other consequences, but I seem

[web2py] Re: AJAX issue with '#' in URL

2010-09-21 Thread Martin.Mulone
I think to deal with your problems is what KMax says On Sep 21, 1:02 am, KMax mkostri...@gmail.com wrote: Did you check errors in admin page?  Ajax errors not easy to catch due their hideness.  Try FireBug or other simular tools (Google chrome IE8 has own build- in) On 13 сен, 10:40, weheh

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread Yannick
Thanks for the note... Humm how did you change this line since it comes as a all package ? Is there a package which has a code change ? Thannks On Sep 21, 6:37 am, villas villa...@gmail.com wrote: Try removing display-name=%{GROUP} from that line.  i.e. Replace   WSGIDaemonProcess web2py

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread villas
I don't know about a package. I had to change a few things to set up my Firebird database etc. So, I adapted the set up script which I ran from the Ubuntu commandline. I saw that this particular line failed, so I played around to get it working. I am sorry to say that my technical approach is best

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread villas
Yannick, just to clarify, I copied the script to my server wget http://web2py.googlecode.com/svn/trunk/scripts/setup-web2py-ubuntu.sh Made the alteration at around line 89. Then ran the script. As I said, I also made other alterations for my own specific circumstances. On Sep 21, 12:10 pm,

[web2py] Re: Problems with sessions in multiple windows...

2010-09-21 Thread mdipierro
You mean you operate two browser windows accessing the same application at the same time. They should share the session but this may be browser dependent. Which one do you use? Execept in the case GAE sessions are locked when accessed which means there can be no corrupton of data. In the case of

[web2py] Re: Deploying web2py on linux (Redhat or others) on cpanel or other ways

2010-09-21 Thread mdipierro
What you see it the output of the web2py function redirect(URL('index')) so I think it is working. On Sep 21, 3:53 am, Rahul rahul.dhak...@gmail.com wrote: I have made the changes as suggested by Jonathan - changes e['REMOTE_ADDR'] to e.get('REMOTE_ADDR', 'localhost'),

[web2py] Re: Creating an upload 'queue'/uploading in the background

2010-09-21 Thread mdipierro
web2py supports upload progress http://www.web2pyslices.com/main/slices/take_slice/10 On Sep 21, 4:24 am, scausten scaus...@gmail.com wrote: Does anyone have ideas on how to implement an upload 'queue'? Specifically, my site allows users to upload mp3s, but I'd like to defer the uploading

[web2py] Re: I need someone's eyes on this!

2010-09-21 Thread mdipierro
this is not a web2py error. OperationalError is a database error. I do not think it is caused by this code. Soemthing is wrong with the db config. On Sep 21, 5:04 am, bally boy ballybo...@gmail.com wrote: Ok so this is a little tweaked code of the estore which Massimo posted. The original one

[web2py] Re: exec from text area...

2010-09-21 Thread mdipierro
disclamer: there security issues in exec-ing user's code but I assume you have good reasons for it. ;-) instead of exec(code) do exec(code.replace('\r\n','\n').strip()+'\n') On Sep 21, 5:31 am, Jason (spot) Brower encomp...@gmail.com wrote: I have a text area that I can grab the python code

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread mdipierro
WSGIDaemonProcess web2py user=www-data group=www-data display-name=% {GROUP} is from the manual but should not be in scripts-web2py-ubuntu.sh which should only contain WSGIDaemonProcess web2py user=www-data group=www-data am I wrong? Anyway, the difference is inconseqential. On Sep 21,

[web2py] problem with python lists in database

2010-09-21 Thread antispameu
Hi, i used to store a python list in the database and in the older release, the list was on the python format (['1','2','3',]) and now with the new releases, lists are stored in a new way (|1|2|3|). So when i browse my query results, i've got a problem, because i don't have the list in result,

[web2py] Re: problem with python lists in database

2010-09-21 Thread mdipierro
Make the field of type list:string. You want to read this: http://groups.google.com/group/web2py/msg/6cffb0c4646e9fe0 On Sep 21, 2:23 am, antispameu afoign...@gmail.com wrote: Hi, i used to store a python list in the database and in the older release, the list was on the python format

Re: [web2py] Re: I need someone's eyes on this!

2010-09-21 Thread bally boy
When I do this, it works fine..but still I am not able to link the categories table to the product table, that is when the error pops up!:- db.define_table('product', Field('name',requires=IS_NOT_IN_DB(db,'product.name')), Field('image','upload'),

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread Yannick
Thanks Villa, I just tried it just like you suggested I alter the script and remove the display-name=% {GROUP} at line 89 and now it seem to work, I got this from the command line: httpd (no pid file) not running [OK] done! I can access the web2py welcome page from my IP BUT I can't access the

Re: [web2py] Re: exec from text area...

2010-09-21 Thread Jason (spot) Brower
Yeah, I just figured that out and have come to tell it now. :D Yeah, I have my reasons and it won't be used in production. BR, Jason Brower On Tue, Sep 21, 2010 at 3:38 PM, mdipierro mdipie...@cs.depaul.edu wrote: disclamer: there security issues in exec-ing user's code but I assume you have

[web2py] Memory usage

2010-09-21 Thread Johann Spies
Yesterday for the first time I deployed web2py on a commercial platform (Webfaction) and today I received two messages from Webfaction that I was using more memory (135Mb) than what the Shared 1 option allowed for (80Mb). And that was before the application was in full use! I have requested an

[web2py] ?requested_uri=None in routes_onerror redirected page

2010-09-21 Thread mwolfe02
I'm troubleshooting my routes_onerror by starting with a simple case, redirecting everything to a status page for debugging: routes_onerror = [(r'*/*', r'/status/'),] When I type the following url into the browser: http://127.0.0.1:8000/faq I get redirected to this url:

[web2py] Re: I need someone's eyes on this!

2010-09-21 Thread mdipierro
Do not know what to say. I do ot use MySQL because it has lots of undocumented quirks. I quick search revealed other cases when the problem may occur (look at the comments): http://www.danieltome.com/blog/2008/01/17/mysql-errno-150/ Anyway. This do not solve your problem. Try give the category

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread mdipierro
where did you get setup-web2py-ubuntu.sh This is the one: http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh the last line prompts you for the password. On Sep 21, 8:17 am, Yannick ytchatch...@gmail.com wrote: Thanks Villa, I just tried it just like you suggested I alter the

Re: [web2py] Re: Problems with sessions in multiple windows...

2010-09-21 Thread Jason (spot) Brower
The issue seems to show up at random times. For example about an hour after my email it started to work and has for the rest of the day. I am using firefox and it will be the only browser it will use unless of course it doesn't have the same sessions in the same window. :D It is very very weird.

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread villas
Maybe these commands might give you a clue in the direction of setting up an admin password for HTTPS... sudo -u www-data bash cd /home/www-data/web2py python -c \from gluon.main import save_password; save_password('secret',443)\ On Sep 21, 2:17 pm, Yannick ytchatch...@gmail.com wrote: Thanks

[web2py] Re: exec from text area...

2010-09-21 Thread mdipierro
I trust you. I had to be careful with my response because I know there are a couple of people here looking for posts they can take out of context, post on reddit, as say see! Massimo suggests using exec of user input. Massimo On Sep 21, 8:39 am, Jason (spot) Brower encomp...@gmail.com wrote:

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread mr.freeze
Is the one mentioned here different? http://www.web2pyslices.com/main/slices/take_slice/29 On Sep 21, 9:01 am, mdipierro mdipie...@cs.depaul.edu wrote: where did you get setup-web2py-ubuntu.sh This is the one: http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh the last line

[web2py] Re: ?requested_uri=None in routes_onerror redirected page

2010-09-21 Thread mdipierro
Have a couple of pending patches. Will try process this within tonight On Sep 21, 8:47 am, mwolfe02 michael.joseph.wo...@gmail.com wrote: I'm troubleshooting my routes_onerror by starting with a simple case, redirecting everything to a status page for debugging: routes_onerror = [(r'*/*',

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread mdipierro
oops. Yes that is from the old svn trunk, not updated in more than one year. Massimo On Sep 21, 9:03 am, mr.freeze nat...@freezable.com wrote: Is the one mentioned here different?http://www.web2pyslices.com/main/slices/take_slice/29 On Sep 21, 9:01 am, mdipierro mdipie...@cs.depaul.edu

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread mdipierro
Problem is... I copied your recipe in the book without checking the url. :-( Massimo On Sep 21, 9:03 am, mr.freeze nat...@freezable.com wrote: Is the one mentioned here different?http://www.web2pyslices.com/main/slices/take_slice/29 On Sep 21, 9:01 am, mdipierro mdipie...@cs.depaul.edu

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread mr.freeze
That's your slice. You can log in and update it to the new link (or I can if you're too busy). On Sep 21, 9:07 am, mdipierro mdipie...@cs.depaul.edu wrote: Problem is... I copied your recipe in the book without checking the url. :-( Massimo On Sep 21, 9:03 am, mr.freeze

[web2py] Re: Simple search form

2010-09-21 Thread elfuego1
Hello, Did you manage to find a cause of the problem? Why the db search is not working? Best wishes, On 19 Wrz, 18:26, mdipierro mdipie...@cs.depaul.edu wrote: My office email server appears to be done. Maintenance perhaps. On Sep 19, 11:13 am, elfuego1 elfue...@gmail.com wrote: Ok.

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread Anthony
Also needs to be changed in the book: http://web2py.com/book/default/chapter/11#One-Step-Production-Deployment On Sep 21, 10:17 am, mr.freeze nat...@freezable.com wrote: That's your slice.  You can log in and update it to the new link (or I can if you're too busy). On Sep 21, 9:07 am,

Re: [web2py] Re: Deploying web2py on linux (Redhat or others) on cpanel or other ways

2010-09-21 Thread Jonathan Lundell
On Sep 21, 2010, at 5:32 AM, mdipierro wrote: What you see it the output of the web2py function redirect(URL('index')) so I think it is working. That part is working, but the the underlying problem seems to be that all that stuff is indeed missing from the environment. If you google

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread mdipierro
done On Sep 21, 9:41 am, Anthony av201...@yahoo.com wrote: Also needs to be changed in the book:http://web2py.com/book/default/chapter/11#One-Step-Production-Deployment On Sep 21, 10:17 am, mr.freeze nat...@freezable.com wrote: That's your slice.  You can log in and update it to the new

[web2py] Re: Simple search form

2010-09-21 Thread mdipierro
Model: db.define_table('numbers', Field('no_1', 'integer', requires=IS_INT_IN_RANGE(0,1)), Field('no_2', 'integer', requires=IS_INT_IN_RANGE(0,1)), Field('no_3', 'integer', requires=IS_INT_IN_RANGE(0,1)), Field('no_4',

[web2py] list:integer or joins?

2010-09-21 Thread Dalen Kruse
I just started out using web2py and I'm really liking it. After reading the DAL chapter in the book, I'd like to get people's opinion on something. If I'm using a relational DB (not GAE), is there an advantage/disadvantage to specifying a relation between tables using a 'list:integer' field over

[web2py] Re: Problems with sessions in multiple windows...

2010-09-21 Thread mdipierro
sorry. I do not understand. Can you list the steps to reproduce the problem, what you see and what you expect? Even if I understand the problem is intermittent. massimo On Sep 21, 8:59 am, Jason (spot) Brower encomp...@gmail.com wrote: The issue seems to show up at random times.  For example

[web2py] Re: list:integer or joins?

2010-09-21 Thread mdipierro
Each of them has pros and cons. list:(string,integer,reference) are the only option on GAE which does not support joins and web2py provide a compatibility layer on RDBS. list:... can be used as a way to normalize the database for speed. Good is you need the items in the list for every record,

[web2py] Showing the ID of the record submitted

2010-09-21 Thread Johann Spies
I was hoping that the following would modify the Record created flash message: def show_id(id): message = crud.messages.record_created = 'Record nr %d created' %id return message def fetm04_create(): table=db.fetm04 #crud.settings.auth = auth # enforces authorization on

[web2py] Export content as .xlsx

2010-09-21 Thread Bruno Rocha
I am using XlsXcessive to export content from my web2py apps to .xlsx http://xlsx.dowski.com/ Should be useful for someone else!

[web2py] Re: expose URL to internal web2py functions

2010-09-21 Thread Avik Basu
I was wondering if it might be possible to limit the URL to functions that are called internally from web2py component calls. In the manual, there is a reference to using a decorator like: @auth.requires(request.cid) Would this be an effective safeguard? Also, is there some way to set this

Re: [web2py] Showing the ID of the record submitted

2010-09-21 Thread Bruno Rocha
form.vars.id contains the id or a newly inserted record. 2010/9/21 Johann Spies johann.sp...@gmail.com I was hoping that the following would modify the Record created flash message: def show_id(id): message = crud.messages.record_created = 'Record nr %d created' %id return message

Re: [web2py] Showing the ID of the record submitted

2010-09-21 Thread Bruno Rocha
You need to use response.flash def show_id(id): message = crud.messages.record_created = 'Record nr %d created' %id response.flash= message return message 2010/9/21 Bruno Rocha rochacbr...@gmail.com form.vars.id contains the id or a newly inserted record. 2010/9/21 Johann Spies

Re: [web2py] Re: I need someone's eyes on this!

2010-09-21 Thread bally boy
Thanks for looking into it Massimo.. I will try using it with SQLite and GAE too! On Tue, Sep 21, 2010 at 7:26 PM, mdipierro mdipie...@cs.depaul.edu wrote: Do not know what to say. I do ot use MySQL because it has lots of undocumented quirks. I quick search revealed other cases when the

Re: [web2py] Showing the ID of the record submitted

2010-09-21 Thread Bruno Rocha
This how I got this working here def show_id(id): message = 'Record nr %d created' %id response.flash= message def create(): table=db.teste #crud.settings.auth = auth # enforces authorization on crud crud.settings.keepvalues = True

Re: [web2py] Showing the ID of the record submitted

2010-09-21 Thread Bruno Rocha
I think you cannot asign a value to crud.messages.record_created after crud is created. You need to define crud settings before the creating of crud form. 2010/9/21 Johann Spies johann.sp...@gmail.com I was hoping that the following would modify the Record created flash message: def

[web2py] How can I do some A/B testing?

2010-09-21 Thread Adi
Hi all, I'd like to A/B test some variations of a view, to see which one has better conversion. For example, there's a page http://myapp.com/app/default/list . Inside this page there's a button which takes user to sign up, http://myapp.com/app/user/login. I wish to try UI variations that result

[web2py] Re: Export content as .xlsx

2010-09-21 Thread Tim Michelsen
I am using XlsXcessive to export content from my web2py apps to .xlsx http://xlsx.dowski.com/ Thanks. Where do you see the advantage over xlwt? And how would you suggest to write to ODT files? Maybe Spreadsheet export could be added as core functionality like CSV export. I think this is most

Re: [web2py] How can I do some A/B testing?

2010-09-21 Thread Ramjee Ganti
Hi Adi, Try using http://visualwebsiteoptimizer.com/ http://visualwebsiteoptimizer.com/Thanks, rAm i Think, i Wait, i Fast -- Siddhartha http://sodidi.ramjeeganti.com On Tue, Sep 21, 2010 at 10:54 PM, Adi aditya.sa...@gmail.com wrote: Hi all, I'd like to A/B test some variations of a

Re: [web2py] Showing the ID of the record submitted

2010-09-21 Thread Johann Spies
Thanks Bruno! --     The fool hath said in his heart, There is no God...                                Psalm 14:1

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread Yannick
Humm Thanks for your note all BUT it seems that the latest script has another error on line 185 on it. I just run the latest script on VPS.net server and here is the error message I keep having Restarting web server apache2 * We failed to correctly shutdown apache, so we're now killing all

[web2py] Re: expose URL to internal web2py functions

2010-09-21 Thread mdipierro
No this is not a security measure. This is only a way to decet whether a certain http header exist and that header is usually set for Ajax calls originted from web2py componenets On Sep 21, 11:17 am, Avik Basu avikb...@gmail.com wrote: I was wondering if it might be possible to limit the URL to

[web2py] String representation of a record

2010-09-21 Thread Jose Hurtado
Hello, just started using web2py a few days ago and liked it so here i am with my first app :) so sorry if my question have been solved, i did a few searches a didn't find it. My problem: I want to get a string representation of a record of a table, this representation can be as easy as 1

[web2py] Re: String representation of a record

2010-09-21 Thread mdipierro
format can be a function db.define_table('person',Field('first_name'),Field('last_name'), format=lambda r: r.first_name+' '+r.last_name) where r is the record to be represented. Hope that helps. On Sep 21, 10:51 am, Jose Hurtado jose.i.hurt...@gmail.com wrote: Hello, just started using

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread mdipierro
Looks like there is a typo in line 185. You do not need it. delete it. On Sep 21, 2:22 pm, Yannick ytchatch...@gmail.com wrote: Humm Thanks for your note all BUT it seems that the latest script has another error on line 185 on it. I just run the latest script on VPS.net server and here is the

[web2py] Problem with shell

2010-09-21 Thread guruyaya
I'm actually reporting 2 problems. Both were found on the images blog from chapter 3 of the book. Both have to do with the shell. 1. This happens when I use web2py.py -S images db Traceback (most recent call last): File console, line 1, in module NameError: name 'db' is not defined 2. This

[web2py] Sharing data between background worker and requests

2010-09-21 Thread Álvaro J . Iradier
Hi, I've setup a background worker thread using cron @reboot. The background worker is polling some serial sensors all the time (there's a loop in class reading the sensor values). On some moment, the values are recorded and an alarm bit is set. Now, what I need is a way to share this

[web2py] Re: Problem with shell

2010-09-21 Thread mdipierro
when you use the console you must use the -M option to execute your models. The problem with the web based shell is well known and I do not have a fix jet. sorry. Massimo On Sep 21, 3:07 pm, guruyaya guruy...@gmail.com wrote: I'm actually reporting 2 problems. Both were found on the images

[web2py] Re: Sharing data between background worker and requests

2010-09-21 Thread mdipierro
If not and you have a single web2py installation you can use a named pipe http://stackoverflow.com/questions/1430446/create-a-temporary-fifo-named-pipe-in-python has pros and cons. data can be lost or corrupted if the reading/ writing app crashes. I would use the database because of transcaction

Re: [web2py] Re: Export content as .xlsx

2010-09-21 Thread Thadeus Burgess
support for office 2007 formats is the biggest thing. ODF format http://www.linuxjournal.com/article/9347 -- Thadeus On Tue, Sep 21, 2010 at 12:30 PM, Tim Michelsen timmichel...@gmx-topmail.de wrote: I am using XlsXcessive to export content from my web2py apps to .xlsx  

[web2py] Re: String representation of a record

2010-09-21 Thread Jose Hurtado
i now have the lambda function defined, but... on the view, how call i the function format, the record is stored under 'row' key on dictionary passed to the view. i tried row.format, row.represent,... but i only get errors :( one thing, my query access the record by the id, not by the reference

[web2py] Bug?: db.mytable(1) shortcut does not work for table with ID field not named 'id'

2010-09-21 Thread mwolfe02
I'm using a legacy tables and trying to use the shortcut method of returning a row/record by passing the value of the ID field directly to the table. It appears that 'id' is still hardcoded into the logic at some level, though. This works: db.mytable(db.mytable.my_id==1) But this does not:

[web2py] Pypi update

2010-09-21 Thread mdipierro
http://pypi.python.org/pypi/web2py/1.85.3 I also also discovered users can vte for Pypi packages. I did not know that.

[web2py] Re: String representation of a record

2010-09-21 Thread mdipierro
You can do db.define_table('person',Field('name')) db.define_table('dog',Field('name')) format=lambda r: r.name+' belongs to '+r.person.name) and for dog in db(db.dog.id0).select(): print db.dog._format(dog) On Sep 21, 3:29 pm, Jose Hurtado jose.i.hurt...@gmail.com wrote: i now have

[web2py] Re: Problem with shell

2010-09-21 Thread guruyaya
Oh. Ok. Thanks for your reply. On Sep 21, 10:24 pm, mdipierro mdipie...@cs.depaul.edu wrote: when you use the console you must use the -M option to execute your models. The problem with the web based shell is well known and I do not have a fix jet. sorry. Massimo On Sep 21, 3:07 pm,

[web2py] Re: Bug?: db.mytable(1) shortcut does not work for table with ID field not named 'id'

2010-09-21 Thread mdipierro
it is a bug but an easy one to fix. On Sep 21, 3:44 pm, mwolfe02 michael.joseph.wo...@gmail.com wrote: I'm using a legacy tables and trying to use the shortcut method of returning a row/record by passing the value of the ID field directly to the table.  It appears that 'id' is still hardcoded

[web2py] Re: Bug?: db.mytable(1) shortcut does not work for table with ID field not named 'id'

2010-09-21 Thread mwolfe02
working on tracing error gets me to line 3196 of sql.py: sql_o += ' ORDER BY %s' % ', '.join(['%s.%s'%(t,x) for t in w2p_tablenames for x in ((hasattr(self._db[t],'_primarykey') and self._db[t]._primarykey) or ['id'])]) Problem is that with this table definition: db.define_table('mytable',

[web2py] Re: Bug?: db.mytable(1) shortcut does not work for table with ID field not named 'id'

2010-09-21 Thread mwolfe02
Here's the patch I came up with. Massimo, if you've already got a fix in, just ignore... diff --git a/gluon/sql.py b/gluon/sql.py --- a/gluon/sql.py +++ b/gluon/sql.py @@ -3193,7 +3193,7 @@ if not attributes.get('orderby', None) and w2p_tablenames: # sql_o

[web2py] Session variable setup at login

2010-09-21 Thread ron_m
I am writing an application where login is required for almost the entire site (Intranet application inside a company). There is an equipment access dictionary structure I called user_access I build from the database at login and cache in the session. I added code to the default controller user

[web2py] FORM without db, how to get field name?

2010-09-21 Thread Keith
I'm trying to figure out how to get field name when using FORM in the controller. I can draw the form input fields or put a label on it, but can't seem to figure out how to just call the form field name as a variable in the view. Ideally I'd like to be able to do something like this in the view:

[web2py] Re: Session variable setup at login

2010-09-21 Thread mdipierro
Looks fine. On Sep 21, 4:34 pm, ron_m ron.mco...@gmail.com wrote: I am writing an application where login is required for almost the entire site (Intranet application inside a company). There is an equipment access dictionary structure I called user_access I build from the database at login

[web2py] Re: String representation of a record [SOLVED]

2010-09-21 Thread Jose Hurtado
Perfect. Solved my problem. :) i didn't try _format, my fault. Thank you very much. On 21 sep, 23:09, mdipierro mdipie...@cs.depaul.edu wrote: You can do db.define_table('person',Field('name')) db.define_table('dog',Field('name'))    format=lambda r: r.name+' belongs to '+r.person.name)

[web2py] Re: String representation of a record

2010-09-21 Thread Anthony
Is this in the book anywhere (i.e., _format)? Thanks. On Sep 21, 5:09 pm, mdipierro mdipie...@cs.depaul.edu wrote: You can do db.define_table('person',Field('name')) db.define_table('dog',Field('name'))    format=lambda r: r.name+' belongs to '+r.person.name) and for dog in

[web2py] Re: FORM without db, how to get field name?

2010-09-21 Thread mdipierro
You are using low level functionality for field in form loops over the tags contained in the form../form which may or may not have a name. Anyway you are looking for form['_name']. I would recommend doing this instead: This is my controller: def roomcreate(): form = SQLFORM.factory(

Re: [web2py] Re: let user choose it membership

2010-09-21 Thread Richard Vézina
Hello Massimo, Here what I found as a temporarily solution : I made a auth_group_allowed that is a m2m relation between auth_user and auth_group. So, we can attribute each user a set of groups in which he is allowed to change with. Then this controller can let the user pick the group he want :

[web2py] Re: String representation of a record

2010-09-21 Thread Jose Hurtado
A quick search gives me only 1 result, on chapter six, on section: Many to Many, list:type, and contains used as a value on a validator. but could be useful for more people to know. cheers. On 22 sep, 00:02, Anthony av201...@yahoo.com wrote: Is this in the book anywhere (i.e., _format)?

[web2py] Re: Memory usage

2010-09-21 Thread Scott
Johann, We don't have a lot of information to work off of here; therefore the culprit could be a lot of things. Typically high memory usage is tied to how your application processes data. I've created applications serving 4 TPS against a 300MB database, with memory usage between 70-80MB and CPU

[web2py] Re: Simple search form

2010-09-21 Thread elfuego1
Thank you Massimo!!! It works on my end as well! ;-) Could you yet tell me how to modify query part, if I'd like to have results shown ONLY, if the numbers are in exactly the same order as they are stored in DB? no_1 == db.numbers['no_1'] no_2 == db.numbers['no_2'] no_3 == db.numbers['no_3']

[web2py] Re: Simple search form

2010-09-21 Thread elfuego1
Thank you Massimo!!! It works on my end as well! ;-) Could you yet tell me how to modify query part, if I'd like to have results shown ONLY, if the numbers are in exactly the same order as they are stored in DB? no_1 == db.numbers['no_1'] no_2 == db.numbers['no_2'] no_3 == db.numbers['no_3']

[web2py] Re: VPS.net for Hosting....

2010-09-21 Thread Yannick
Oh I was able to successfully play with DB on VPS by installing phppgAdmin and access it remotely. I was thinking I need a special setting. I'm still looking for tutorial to be able to send email using Postfix or any other tool from my Application on VPS VM. Thanks again for your help. On Sep

[web2py] VPS.net With Web2py.... Unable to install Application

2010-09-21 Thread Yannick
Hello mate, I'm new with VPS Hosting... I just installed Web2py, Postgres Admin... From the Admin Console of Web2py I tried to install the application through the Upload install packed application form and i got a message saying Unable to Install the application The application was 44MB, so

[web2py] Re: String representation of a record

2010-09-21 Thread mdipierro
no. On Sep 21, 5:02 pm, Anthony av201...@yahoo.com wrote: Is this in the book anywhere (i.e., _format)? Thanks. On Sep 21, 5:09 pm, mdipierro mdipie...@cs.depaul.edu wrote: You can do db.define_table('person',Field('name')) db.define_table('dog',Field('name'))    format=lambda r:

[web2py] Re: Memory usage

2010-09-21 Thread mdipierro
Make sure cron is disabled (should default off with mod_wsgi but defaults to on with rocket). Also be careful not to use cache.ram keys that are input dependent. On Sep 21, 8:47 am, Johann Spies johann.sp...@gmail.com wrote: Yesterday for the first time I deployed web2py on a commercial

[web2py] Re: Simple search form

2010-09-21 Thread mdipierro
replace s=[int(form.vars['no_%i'%i]) for i in keys if form.vars['no_ %i'%i]!=None] query=reduce(lambda a,b:a|b,[db.numbers['no_%i'%i].belongs(s) for i in keys]) with query=reduce(lambda a,b:ab,[db.numbers['no_ %i'%i]==form.vars['no_%i'%i]) for i in keys]) On Sep 21,

[web2py] Re: VPS.net With Web2py.... Unable to install Application

2010-09-21 Thread mdipierro
This is a file permission issue. web2py does not have permission to write on the file system. I assume you are not running web2py form your account but you are accessing it via port 80 (apache). In this case make sure cd /home/www-data chown -R www-data:www-data web2py On Sep 21, 10:49 pm,

[web2py] Re: Memory usage

2010-09-21 Thread Christopher Steel
Hi Johann, Web2py is microscopic itself. 55Mb over is a lot! I have a really hard time imagining how this might happen from Web2py. Have you got anything else running on your account like Plone or Mercurial (pulling large files like photos?) Any breakdown you can get on memory usage might help

[web2py] Dashboard of GAE shows few errors

2010-09-21 Thread b vivek
1. Hi! I just uploaded an app on appspot and it works fine.. but when I check the dashboard.. I get few errors been displayed like below. Well for the drivers not found, I understand that they are obviously not there on GAE. But is there a place I could go an disable web2py from

[web2py] Re: Memory usage

2010-09-21 Thread mdipierro
Are you running web2py.py or wsgihandler? If you are starting web2py.py you may want to comment import gluon.import_all it is there to detect missing/buggy modules but it causes it to use more memory than necessary. Massimo On Sep 22, 12:02 am, Christopher Steel chris.st...@gmail.com wrote:

[web2py] Re: Dashboard of GAE shows few errors

2010-09-21 Thread mdipierro
This on the TODO like. Do not log obvious warnings if running on GAE. Massimo On Sep 22, 12:03 am, b vivek bvivek1...@gmail.com wrote:    1. Hi!    I just uploaded an app on appspot and it works fine.. but when I check    the dashboard.. I get few errors been displayed like below. Well for

Re: [web2py] Re: Dashboard of GAE shows few errors

2010-09-21 Thread b vivek
I am sorry Massimo.. but I dont get you... Do you mean it is still to be worked upon On Wed, Sep 22, 2010 at 10:43 AM, mdipierro mdipie...@cs.depaul.edu wrote: This on the TODO like. Do not log obvious warnings if running on GAE. Massimo On Sep 22, 12:03 am, b vivek bvivek1...@gmail.com

[web2py] strange problem on auth.requires_login with 1.85.3

2010-09-21 Thread vince
upgraded to 1.85.3, was using 1.83 or something like that (can't remember) only one of our server experience the problem with auth.requires_login sometimes return false and send user back to login page. for the problem server, it only occur with https, http connect is fine. this problem is very