[web2py] Re: get variables in view from other controller

2011-03-19 Thread Anthony
On Saturday, March 19, 2011 5:18:23 PM UTC-4, LightOfMooN wrote: > > no, it doesn't be a controller. > But I can not use ajax too, because I need variables in template, but > not the rendered block. > (and I don't like that LOAD() loads components in new div, because it > may cause a problems

[web2py] Re: Backup/Restore problem with web2py, postgres

2011-03-19 Thread Massimo Di Pierro
ask web2py to repair it auth.define_tables(fake_migrate=True) On Mar 19, 10:16 pm, VP wrote: > I've had problems with backup/restore.  These could be very serious > problems.  So,  with version 1.94.5, I simulated a backup/restore > scenario and found a problem. > > 1. Backup up database with (p

[web2py] Re: How to build windows binary yourself?

2011-03-19 Thread Massimo Di Pierro
I do not build the windows version. I did it once last time 2 years ago. Since than I only replace the pyc files and rezip. It is possible we added some files that broke the py2exe script. Moreover I do not use windows myself. If you have fixed it and want to email a revised script I will post it.

[web2py] Re: from a csv file to a web2py app

2011-03-19 Thread mart
Can't blame you for keeping that competitive advantage, it does seem like a winning app to me! :) the py docs do mention using a try/except bloc with wrapper() and also some good info in the python bug reports (http://bugs.python.org/ issue7567 as an example). hope it helps, and let me know if y

[web2py] Backup/Restore problem with web2py, postgres

2011-03-19 Thread VP
I've had problems with backup/restore. These could be very serious problems. So, with version 1.94.5, I simulated a backup/restore scenario and found a problem. 1. Backup up database with (psql_dump database > database.sql) 2. Create another database (psql database2 < database.sql) 3. Replace

[web2py] Re: web2py ProgrammingError: relation "auth_user" already exists

2011-03-19 Thread VP
Yes. I've been able to "fixed" this, but it's ugly. I'm going to create a new topic to describe this problem (this topic is convoluted with many variables (upgrades, etc.)). On Mar 19, 8:29 pm, villas wrote: > Just a guess, but did you back up the DB and then restore to a > different name? > >

Re: [web2py] squeeze + Apache2 = lots of RAM

2011-03-19 Thread Luis Díaz
next week I test with that configuration, whatever the result will comment Díaz Luis http://www.facebook.com/diazluis2007 TSU Analisis de Sistemas Universidad de Carabobo Facultad de Odontología 2011

[web2py] How to build windows binary yourself?

2011-03-19 Thread Brian M
I was going to take a shot at building my own windows exe version of web2py and see if I could get pyodbc included, but ran into a problem. I started out with the source distribution of web2py 1.94.5. and then ran > python setup_exe.py web2py Everything seems to start building OK until it begi

[web2py] Re: book "bugs"

2011-03-19 Thread villas
:-) On Mar 19, 3:31 am, Kevin Ivarsen wrote: > villas: tonight I went through the edits you made, and just about everything > looks like it was correctly added to the book, including these two IS_DATE > corrections. Thanks for your work on this! > > Kevin

[web2py] Re: Where is the Shell ????

2011-03-19 Thread villas
Open a dos commandline window, navigate to the web2py directory, type: c:\web2py> python web2py.py --help which shows all the options available. Try this: c:\web2py> python web2py.py -N -M -S your_app_name_here This opens a shell in the context of your_app, then for example, you may be able t

[web2py] Re: web2py ProgrammingError: relation "auth_user" already exists

2011-03-19 Thread villas
Just a guess, but did you back up the DB and then restore to a different name? It looks like web2py is trying to re-create the DB. Try setting migrate = False, fake_migrate = True. Look up those settings in the book, in the DAL chapter. Regards, D On Mar 20, 12:38 am, VP wrote: > btw, I back

[web2py] Re: web2py ProgrammingError: relation "auth_user" already exists

2011-03-19 Thread VP
btw, I backed up (in postgres 8.3) using: "pg_dump database > database.sql" and restored (in postgres 8.4) using: "psql database < database.sql"

[web2py] Re: web2py ProgrammingError: relation "auth_user" already exists

2011-03-19 Thread VP
To be clear, essentially this is what happened. I backed up web2py folder, and postgres database separately. Then, I upgraded the os, including postgres to version 8.4. After that, I unzipped the web2py folder and installed the database. And I have this problem. This is quite frustrating. H

Re: [web2py] Re: from a csv file to a web2py app

2011-03-19 Thread Jonathan Lundell
On Mar 19, 2011, at 4:36 PM, Massimo Di Pierro wrote: > > for me curses endwin does not restore console settings. I tried > curses.wrapper and no luck. curses! There are a couple of stty hacks, if you're willing to call out to stty (with the terminal as stdin). stty sane will do sort of what i

[web2py] Re: from a csv file to a web2py app

2011-03-19 Thread Massimo Di Pierro
for me curses endwin does not restore console settings. I tried curses.wrapper and no luck. On Mar 19, 6:28 pm, Jonathan Lundell wrote: > On Mar 19, 2011, at 3:37 PM, Massimo Di Pierro wrote: > > > > > > > > > > > > > Let me keep my competitive advantage for a while. ;-) > > > Besides I have this

Re: [web2py] Re: from a csv file to a web2py app

2011-03-19 Thread Jonathan Lundell
On Mar 19, 2011, at 3:37 PM, Massimo Di Pierro wrote: > > Let me keep my competitive advantage for a while. ;-) > > Besides I have this problem I cannot solve. Consider this code: > > import terminal > import time > import sys > import curses > import os > > screen = curses.initscr() > curses.n

[web2py] web2py ProgrammingError: relation "auth_user" already exists

2011-03-19 Thread VP
After upgrading debian to version 6, postgres was upgraded to 8.4. I had to create a new user, new database. Well, this didn't go well. I had previously backed up my database. Now after restoring my postgres db, I had the error above. "auth_user" already exists. I have no idea how to fix th

[web2py] Where is the Shell ????

2011-03-19 Thread Ovidio Marinho
In version 1.93.2 the web2py not appear because the Shell? where is the Shel on Windows Vista. -- Ovidio Marinho Falcao Neto ovidio...@gmail.com Tecnologia da Informaçao Casa Civil do Governador 83 3214 7885 - 88269088 Paraiba

[web2py] Re: from a csv file to a web2py app

2011-03-19 Thread Massimo Di Pierro
Let me keep my competitive advantage for a while. ;-) Besides I have this problem I cannot solve. Consider this code: import terminal import time import sys import curses import os screen = curses.initscr() curses.nocbreak() curses.echo() curses.endwin() curses.noraw() curses.nl() #curses.setupt

[web2py] Re: from a csv file to a web2py app

2011-03-19 Thread mart
Massimo, you are enjoying this way too much! ;) Just kidding :) This is fantastic! I love this approach (input csv, process, then output) - its clean, clear, concise and immensely usable! Thanks :) P.s. Can we use your new and amazing application, kryten ? pretty please? :) :) On Mar 19, 6:07

[web2py] Re: my newbie questions have been ignored

2011-03-19 Thread Anthony
Hi Terrance, Welcome to web2py. I think in general you'll find that you get very good support here, particularly given that the community is not huge and everyone here is volunteering their time. Actually, so far I'd say you're doing pretty well -- your first two questions were answered withi

[web2py] Re: 1.94.5 is OUT

2011-03-19 Thread mart
So, there does still seem to be some disconnect between a) what version appAdmin is reading from web2py.com, this is most probably correct b) once upgraded, appAdmin is reporting version 1.94.5 from the main page, and the web2py server console (info/about box) says 1.94.4 (i imagine if I close and

[web2py] from a csv file to a web2py app

2011-03-19 Thread Massimo Di Pierro
http://vimeo.com/21239786

[web2py] squeeze + Apache2 = lots of RAM

2011-03-19 Thread VP
Anybody is using Apache2 with Debian 6? I just upgraded from Debian 5 to 6, and notice an obscene amount of memory taken by Apache2, which almost 600MB. Unbelievable. In Debian 5, it took about 300MB. I am guessing I'll have to go with another server then.

[web2py] Re: get variables in view from other controller

2011-03-19 Thread pbreit
You can drop it anywhere in the models directory. In fact, you could have a utils.py file in models.

[web2py] Re: adding auth later?

2011-03-19 Thread Pystar
Just check out db.py model file and delete what you dont need. On Mar 19, 9:37 pm, Pystar wrote: > Every new app comes with Auth already defined, so you would have to > either comment it out or delete completely. its extremely easy to put > in. > > On Mar 19, 4:50 am, Massimo Di Pierro > wrote:

[web2py] Re: get variables in view from other controller

2011-03-19 Thread LightOfMooN
no, it doesn't be a controller. But I can not use ajax too, because I need variables in template, but not the rendered block. (and I don't like that LOAD() loads components in new div, because it may cause a problems with css and jquery) So, I think, a one good way is to define some function in db.

[web2py] Re: adding auth later?

2011-03-19 Thread pbreit
If you commented out or deleted this line in layout.html, you'd never see Auth: {{try:}}{{=auth.navbar(action=URL('default','user'))}}{{except:pass}}

[web2py] Re: get variables in view from other controller

2011-03-19 Thread pbreit
You can set Ajax=False in LOAD(). Does the source function need to be a controller? If not, can you put it in a model or elsewhere?

[web2py] Re: adding auth later?

2011-03-19 Thread Pystar
Every new app comes with Auth already defined, so you would have to either comment it out or delete completely. its extremely easy to put in. On Mar 19, 4:50 am, Massimo Di Pierro wrote: > Basically you would need to add this to model > > from gluon.tools import Auth > auth=Auth(globals(),db) > a

[web2py] Re: get variables in view from other controller

2011-03-19 Thread Anthony
You're probably better off with LOAD, but if you don't want to use Ajax, maybe exec_environment would work: http://web2py.com/book/default/chapter/04#Execution-Environment Does options() have to be a controller action (i.e., does it ever need to be called via a URL)? If not, you could also sim

[web2py] Re: get variables in view from other controller

2011-03-19 Thread LightOfMooN
Yes, I know it. I very like bluebream because of pull (it's not for propagation :) And it's too hard for me to develop without it, but I try. So, maybe is there a way to prepare some variables in some function and then use it by calling prepare-function from needed function? Something like: myco

[web2py] Re: get variables in view from other controller

2011-03-19 Thread Massimo Di Pierro
There are two types of frameworks: push and pull. In push once controller pushes variables to one view. In pull one view pulls variables from multiple controllers. Web2py, Django, TG, Pylons, Pyramid, Flask, are push frameworks. You are trying to use a push framework as a pull one and that is no

[web2py] get variables in view from other controller

2011-03-19 Thread LightOfMooN
How can I get variables in view from other controller? For example: mycontroller/ def options(): return dict(a='hello', b='world') and in some view I need something like this: {{ options = mycontroller/options() }} {{=a}} {{=b}}

[web2py] Re: Updating from windows: patch for admin/default.py

2011-03-19 Thread Massimo Di Pierro
Thanks Nico On Mar 19, 12:54 pm, Nico de Groot wrote: > This patch > (1) repairs a small format error in the code that checks the version : > %*s* which caused the check upgrade button to fail > (2) restores the upgrade button for windows running from source. The > last change is not tested on mu

[web2py] GAE Tip of the Day - cached static files after version change

2011-03-19 Thread howesc
Hi all, GAE changed something recently such that when i update my application version it still serves *old* copies of my static files. Bad Google! With the help of some friends here: https://groups.google.com/forum/#!topic/google-appengine/izSeUolA1ho I came up with this for use in web2py:

[web2py] Updating from windows: patch for admin/default.py

2011-03-19 Thread Nico de Groot
This patch (1) repairs a small format error in the code that checks the version : %*s* which caused the check upgrade button to fail (2) restores the upgrade button for windows running from source. The last change is not tested on multiple machines, but the feature is experimental anyway. But feel

Re: [web2py] Re: 1.94.5 is OUT

2011-03-19 Thread Martin Weissenboeck
I do not have any proxy installed, but you are right - Google Chrome makes some strange things. It seems, that Chrome has it's own proxy Now I have used Opera and I have got 1.94.5 2011/3/19 Massimo Di Pierro > I just did it again and I get 1.94.5. You must be behind a proxy. We > do not c

[web2py] Re: SyntaxError: not enough information to build the url

2011-03-19 Thread pbreit
I would suggest trying the "simple app creation". It's pretty easy to customize your app manually. And you also get a better understanding of creating models and various other framework aspects. The simple app creations are immediately functional.

[web2py] Re: 1.94.5 is OUT

2011-03-19 Thread Massimo Di Pierro
I just did it again and I get 1.94.5. You must be behind a proxy. We do not cache it. On Mar 19, 8:59 am, Martin Weissenboeck wrote: > Five minutes ago I have downloaded again web2py_win > Content of the file web2py\VERSION: > Version 1.94.4 (2011-03-18 02:53:34) > > Regards, Martin > > 2011/3/19

[web2py] Re: my newbie questions have been ignored

2011-03-19 Thread pbreit
I looked at both your questions and couldn't really understand what you were reporting.

[web2py] Re: index.yaml not automatically generated in GAE SDK

2011-03-19 Thread Richard
Thanks for all replies. I think I understand this much better now. It's great to see an active and helpful user group for web2py, I expect I'll be back in here before too long :-) On Mar 19, 12:45 am, howesc wrote: > Richard, > > if your query only orders or filters on a single property no index

[web2py] Re: my newbie questions have been ignored

2011-03-19 Thread Massimo Di Pierro
Hello Terrance, Sometimes it happens that a question is, by mistake, ignored. That is not your case. The problem is that you posted after 4pm on Friday (US time) and Friday night is not very active time in this group. In fact it is the most active time. I see now all your questions have been answ

[web2py] Re: why is my database zero-length after commiting a record

2011-03-19 Thread Nik Klever
your database is located in the folder ../web2py/applications/tmp/ databases/ On 19 Mrz., 00:18, metaperl wrote: > web2py shell transcript of session resulting in no records in sqlite > storage.db file after doing an insert with no error: > > [thequietcenter@ubuntu ~/prg/yinyogaworks] ../web2p

[web2py] Re: why is my database zero-length after commiting a record

2011-03-19 Thread Nik Klever
your database is located in the folder ../web2py/applications/tmp/ databases/ On 19 Mrz., 00:18, metaperl wrote: > web2py shell transcript of session resulting in no records in sqlite > storage.db file after doing an insert with no error: > > [thequietcenter@ubuntu ~/prg/yinyogaworks] ../web2py

[web2py] Re: Using controller in layout

2011-03-19 Thread Hybride
Exactly what I needed - thanks! Now to fix up the controller, but thank you for point me in the right direction. On Mar 19, 10:25 am, Anthony wrote: > Have you looked into using components and > LOAD:http://web2py.com/book/default/chapter/13#Components? > > Anthony > > > > On Saturday, March 19,

[web2py] Re: SyntaxError: not enough information to build the url

2011-03-19 Thread Anthony
Can you point to the other 3 instances of the problem? Can you reproduce the problem, and if so, can you describe the exact steps to do so? And what version of web2py are you using? On Friday, March 18, 2011 5:31:28 PM UTC-4, metaperl wrote: > The archives have 3 instances of this problem, but

Re: [web2py] SyntaxError: not enough information to build the url

2011-03-19 Thread Jonathan Lundell
On Mar 18, 2011, at 2:31 PM, metaperl wrote: > > The archives have 3 instances of this problem, but their solutions do > not apply to me. Here is a link to the ticket for the failed > application creation: > > http://static.livingcosmos.org/tmp/127.0.0.1.2011-03-18.17-17-30.156fa84f-4485-4a40-937

[web2py] Re: Using controller in layout

2011-03-19 Thread Anthony
Have you looked into using components and LOAD: http://web2py.com/book/default/chapter/13#Components? Anthony On Saturday, March 19, 2011 11:13:17 AM UTC-4, Hybride wrote: > Hi everyone, > > I've been trying to include a separate page with database code into > the layout to no avail. The rea

[web2py] Using controller in layout

2011-03-19 Thread Hybride
Hi everyone, I've been trying to include a separate page with database code into the layout to no avail. The reason for this is am trying to deploy the application on GAE, and without actually putting the code in a controller, GAE throws a fit on me. A regular database query works fine for the un-

Re: [web2py] Re: Best way to return all users who have a specific role?

2011-03-19 Thread rochacbruno
In shell you need to fire db.commit() to persist changes. Em 19/03/2011, às 10:23, Tom Atkins escreveu: > Hmm - I spoke too soon. Database changes work OK from controllers but not > from shell... > > On 19 March 2011 13:03, Tom Atkins wrote: > Oops - my mistake - I was using Navicat to lo

Re: [web2py] Re: 1.94.5 is OUT

2011-03-19 Thread Martin Weissenboeck
Five minutes ago I have downloaded again web2py_win Content of the file web2py\VERSION: Version 1.94.4 (2011-03-18 02:53:34) Regards, Martin 2011/3/19 mart > Hi, > > Jus tried it (twice) and still no go for me It does spot the > correct version when checking , then I can got through the nex

Re: [web2py] Re: Best way to return all users who have a specific role?

2011-03-19 Thread Anthony
Are you using the web-based shell in admin? If so, try a regular Python shell instead -- the admin shell seems to have some limitations. On Saturday, March 19, 2011 9:23:37 AM UTC-4, Tom A wrote: > Hmm - I spoke too soon. Database changes work OK from controllers but not > from shell... > > O

[web2py] Re: non redirection when authentication fails

2011-03-19 Thread Joaquin Orbe
Hi, a workaround for this (and I like it) is: auth = Auth(globals(),db, request.controller) With this I redirect to the login page for the correct controller when authentication fails. Regards, Joaquin. On Tue, Mar 15, 2011 at 12:15 PM, Joaquin Orbe wrote: > Hi All, > > I have "two kind of use

Re: [web2py] Re: Best way to return all users who have a specific role?

2011-03-19 Thread Tom Atkins
Hmm - I spoke too soon. Database changes work OK from controllers but not from shell... On 19 March 2011 13:03, Tom Atkins wrote: > Oops - my mistake - I was using Navicat to look at my sqllite database and > had left it open. hence sqllite db was locked. > > > On 19 March 2011 10:41, Tom Atki

Re: [web2py] Re: Best way to return all users who have a specific role?

2011-03-19 Thread Tom Atkins
Oops - my mistake - I was using Navicat to look at my sqllite database and had left it open. hence sqllite db was locked. On 19 March 2011 10:41, Tom Atkins wrote: > Thanks Massimo - I was considering using accessible_query. > > However, I've now got a problem before I try that - auth.add_permi

[web2py] Re: why is my database zero-length after commiting a record

2011-03-19 Thread Tom A
Do you have another instance of web2py running in addition to the shell instance? If you do, then the sqllite db will be locked and the inserts will fail. Try stopping all other instances of web2py.

Re: [web2py] my newbie questions have been ignored

2011-03-19 Thread Tom Atkins
Sorry to hear your questions didn't get answered more quickly. I'm a relative newbie here and have always been impressed with the speed, helpfulness and friendliness of the group. Don't give up yet! With regard to the issues you're having with database commits I too am having problems in the las

[web2py] my newbie questions have been ignored

2011-03-19 Thread Terrence Brannon
I have written to this list with my problems * http://groups.google.com/group/web2py/browse_thread/thread/c40a1ddcbcfe99ea# * http://groups.google.com/group/web2py/browse_thread/thread/692df385b5d3308b# and in 24 or so hours there has been no response. I saw the recent reddit threads. I

Re: [web2py] Re: Newbie questions

2011-03-19 Thread Niklas Rosencrantz
On Wed, Mar 16, 2011 at 12:46 PM, Anthony wrote: > On Wednesday, March 16, 2011 5:29:09 AM UTC-4, Nick Rosencrantz wrote: > >> Hi >> I just deployed my first attempt to try web2py with google app engine >> (http://matochsovklockan.appspot.com) >> Basically it works while a few links return "inval

Re: [web2py] Re: Best way to return all users who have a specific role?

2011-03-19 Thread Tom Atkins
Thanks Massimo - I was considering using accessible_query. However, I've now got a problem before I try that - auth.add_permission doesn't seem to be working: auth.add_permission(1, 'read', db.auth_user, 0) 1 but when I look in the auth_permission table there are no entries. I've tried thi

[web2py] Re: 1.94.5 is OUT

2011-03-19 Thread mart
Hi, Jus tried it (twice) and still no go for me It does spot the correct version when checking , then I can got through the next couple of buttons, and will download. but when I bounced the server, it tells me Version 1.94.4 (2011-03-18 02:53:34) No, just checked the VERSION file and that say