Re: [web2py] Re: New web2py logo? [just for fun]

2011-02-12 Thread Marin Pranjic
I set it as a wallpaper on my mobile, hope your daughter won't mind :)

On Sat, Feb 12, 2011 at 8:51 AM, Changju  wrote:

>
> How sweet:)
> On 2월12일, 오전2시36분, Anthony  wrote:
> > My 4-year-old daughter has been practicing her writing recently.
> Yesterday,
> > she handed this to me (she must have found the book on my desk and copied
> > the title). Apparently web2py makes her think of hearts and flowers, as
> it
> > does for most people. :)
> >
> > Anthony
> >
> >  new_web2py_logo.png
> > 20K보기다운로드
>


Re: [web2py] Re: New web2py logo? [just for fun]

2011-02-12 Thread Michele Comitini
Simply beatiful!
We need a "contributed art" section on web2py.com!

mic

2011/2/12 Marin Pranjic :
> I set it as a wallpaper on my mobile, hope your daughter won't mind :)
>
> On Sat, Feb 12, 2011 at 8:51 AM, Changju  wrote:
>>
>> How sweet:)
>> On 2월12일, 오전2시36분, Anthony  wrote:
>> > My 4-year-old daughter has been practicing her writing recently.
>> > Yesterday,
>> > she handed this to me (she must have found the book on my desk and
>> > copied
>> > the title). Apparently web2py makes her think of hearts and flowers, as
>> > it
>> > does for most people. :)
>> >
>> > Anthony
>> >
>> >  new_web2py_logo.png
>> > 20K보기다운로드
>


[web2py] Re: What user is logged in (or, restricting access based on user)

2011-02-12 Thread villas
You can't give permissions to users,  only to groups.  Therefore the
only way to give permissions to a unique user is through their unique
group. The book gives an example where this is used in the section
Authorization and CRUD.

You don't need to use the inidividual user groups. I have never needed
to use them. Just turn them off and do your own thing:
auth.settings.create_user_groups = False


On Feb 12, 2:56 am, pbreit  wrote:
> I get the concept of groups which is why I was confused that web2py auth
> creates a auth_group.role for each individual user (user_1, user_2 and so
> on).
>
> In all of my apps I have just one class of users. Sometimes, only the
> created_by can view an item. And usually, only the create_by can edit an
> item. And on pretty much every page I have personalizations based on the
> logged in user. Almost every web site I can think of works like this.


[web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-02-12 Thread Carl
I've avoided editing oauth10a_account.py by moving the directory
oauth2 to web2py (and keeping httplib2 inside oauth2.

Not happy that I've put this in Web2py's root but I've avoided editing
the framework source and don't need to worry about overwriting files
when I upgrade Web2py.

On Feb 11, 1:46 pm, Carl  wrote:
> I'm using OAuth/LinkedIn on GAE.
>
> To get oauth/LinkedIn to run on dev_appserver/GAE I had to copy
> directory oauth2 from web2py/site-packages to web2py/gluon/contrib and
> httplib2 from site-packages to web2py/gluon/contrib/oauth2
>
> Then in oauth10a_account.py change "import oauth2 as oauth" to "import
> gluon.contrib.oauth2 as oauth".
>
> Bingo.
>
> But.. is there a convention that will make web2py upgrades
> straightforward?


[web2py] Re: Authorization for Webhooks

2011-02-12 Thread AsmanCom
First things first, Thanks a bunch for your reply.

"Can you just read the cookie"

Yes: request.cookies

"and match it to a session?"

I would like to, but I do not know how?

"Do these callbacks occur quickly enough that the session has not
expired?"

Yes.

"the callback is not technically "logged in" (it has stolen a cookie)"

I dare say it's quite true, but the only thing I still need to know
is:

How to get these two values by the given session_id,
1. is_logged_in (boolean)
2. username or user email (string)

I would be great if Someone could help with this...

Thanks

On 11 Feb., 18:41, pbreit  wrote:
> Can you just read the cookie and match it to a session? Do these callbacks
> occur quickly enough that the session has not expired? I don't know exactly
> how sessions work but I could imagine there's be problems using sessions
> with callbacks since the callback is not technically "logged in" (it has
> stolen a cookie).


[web2py] Re: new support platform for web2py - make money

2011-02-12 Thread Francisco Costa
didn't know about it..
when will you release it?


Re: [web2py] new support platform for web2py - make money

2011-02-12 Thread Ovidio Marinho
Francisco voce pode disponibilizar o codigo para podermos ver as novidades
que vc colocou nesta app, tipo campos arredondados , icones e etc...

2011/2/11 Francisco Costa 

> Hello!
> During the past months I'm using a lot web2py.
> I've been asking a few questions here in this group and I've received
> help from people all around the world. Sometimes I really felt like I
> should give back something to those kind souls..
>
> So that's why in the past 2 days I've created http://askvalue.com/
> (using web2py).
> This is alpha version, and I would like your feedback.
>
> AskValue aims to be a social platform of questions and answers where
> you can make money by doing a valuable question/comment or by
> providing quality answers.
>
> How do you win money? You must have a Flattr.com account (optional)
> and create a "thing" with your site profile:
> http://askvalue.com/user/username
>
> If the user gives you credit I believe that you will be flattred (make
> money)
> If you register you can follow your friends, and receive their updates
> (dashboard under construction).. or you can only follow questions of
> your interest.
> You can also vote on your favorite answers!
>
> I'm also planning to implement during the next week email-
> notifications.
>
> I think that this kind of service can encourages users to help more!
> I also believe that Google Groups is very limited and old-fashionable
> for support, and with this you can have a much richer experience.
>
> Please help me by providing me your honest feedback.
> and please don't mock on my design skills.. I need more time for it :)
>



-- 
Ovidio Marinho Falcao Neto
 ovidio...@gmail.com
 Tecnologia da Informaçao
 Casa Civil do Governador
 83 3214 7885 - 88269088
  Paraiba


Re: [web2py] Re: web2py not using global http_proxy

2011-02-12 Thread Luis Díaz
I'm using a virtualization solution. (Proxmox)

I have a debian server 5,
installed by minimal changes in the script
"Setup web2py + apache + ssl + mod_wsgi + postgresql in FEW seconds"
I do not use postgresql on this server.

I have another server with debian virtualized 5 and in this I have
configured to allow external connections postgresql

I noticed a 638Mb memory consumption on the first server without
ejecutandoce web2py applications.

could comment as configurastes web2py and Cherokee

I want to lose the memory consumption and increase performance.



2011/2/12 whowhywhat 

> Thanks for the quick replies.
> As Luis mentions i have used export http_proxy (but in /etc/
> environment and in the startup script of cherokee). I will try
> defining in /etc/profile
> i did some further testing by launching web2py with its own web
> server.
> by running "python web2py.py -c server.crt -k server.key -a password -
> i  -p "
> This way web2py uses the proxy seamlessly (It works fine!)
>
> but when i deploy using wsgi either in apache or cherokee web2py does
> not see the proxy. what could be wrong? where is this problem
> occurring?
>
> Luis .. which is the web server and cgi setup you are using?
>
> i am really impressed with the speed of cherokee + wsgi + web2py, the
> memory foot print is small and the whole thing runs like greased
> lightning :D .. i just hope to solve this proxy issue.
>
> On Feb 11, 10:50 pm, Luis Díaz  wrote:
> > I forgot.
> > if you need to specify username and password
> > then the structure would be something.
> >
> > export http_proxy =http://username:password@proxy:port/
> > export https_proxy =http://username:password@proxy:port/
> > export ftp_proxy =http://username:password@proxy:port/
> >
> > 2011/2/11 Luis Díaz 
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > Greetings,
> > > web2py I mention that I use in my work.
> > > and we have a proxy that we restrict the output
> > > by user name and password
> >
> > > I have solved the problem properly configuring the proxy on the
> computer
> > > where I have installed debian web2py
> >
> > > nano /etc/profile
> >
> > > adding the following lines:
> >
> > > export http_proxy =http://proxy.uc.edu.ve:5010/
> > > export https_proxy =http://proxy.uc.edu.ve:5010/
> > > export ftp_proxy =http://proxy.uc.edu.ve:5010/
> >
> > > 2011/2/11 Massimo Di Pierro 
> >
> > > Thanks for your comments.
> >
> > >> WHen you need urllib, and web2py.python makes outbound connections you
> > >> should not need a proxy server or any proxy configuration as far as I
> > >> can tell (and I am not sure about your setup). This looks more of a
> > >> firewall issue.
> >
> > >> On Feb 11, 5:19 am, whowhywhat  wrote:
> > >> > web2py is the first framework i actually enjoy using. :) .. been
> > >> > advocating it to everyone i meet these days. I sincerely thank the
> > >> > entire web2py community for everything.
> >
> > >> > I have been developing a small web2py application for intranet use
> at
> > >> > the place where i work. During development i used windows (i carry
> > >> > web2py on a thumb drive). At work we use a proxy for net access and
> in
> > >> > windows i have no problems with web2py accessing the net using the
> > >> > proxy.
> > >> > I can use urllib to fetch webpages etc.
> >
> > >> > To deploy the app i am using Ubuntu. I have deployed web2py using
> both
> > >> > apache as well as Cherokee using WSGI. The application runs fine.
> > >> > however the web2py environment is not able to fetch anything from
> the
> > >> > internet. urllib does not fetch any webpages. I have explicitly set
> > >> > the http_proxy environment variable (in /etc/environment, in the
> > >> > Cherokee startup script). I need to fetch data from the web, mostly
> > >> > for openID authentication. I am not sure what's wrong.
> >
> > >> > how can i make web2py/python use the proxy server (http_proxy)?
> >
> > > --
> > > Díaz Luis
> > > TSU Analisis de Sistemas
> > > Universidad de Carabobo
> >
> > > Facultad de Odontología<
> http://www.odontologia.uc.edu.ve/index.php?option=com_content&view=ar...>
> >
> > --
> > Díaz Luis
> > TSU Analisis de Sistemas
> > Universidad de Carabobo
> >
> > Facultad de Odontología<
> http://www.odontologia.uc.edu.ve/index.php?option=com_content&view=ar...>




-- 
Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo

Facultad de 
Odontología


[web2py] form.accepts() with reference to other table

2011-02-12 Thread Oskari
Hi!

I'm having trouble making an insert with form.accepts()

Currently I have a custom auth_user that has one extra field:
Field('accountID', db.accounts) with
custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,id)

While trying to modify variables it fails with "not found in db"

def func():
form=SQLFORM(db.auth_user)
request.vars.accountID = 1
if form.accepts(request.vars,session):
response.flash = "Succesfully created user"
return dict(form=form)

Why does not form.accepts() recognize and accept my accountID?


[web2py] .represent not representing

2011-02-12 Thread Johann Spies
I get the following output :

inwoner.idinwoner.vaninwoner.adres1Spies1
the following code:

db.define_table('adres',
 Field('straat'))


db.define_table('inwoner',
 Field('van'),
 Field('adres', db.adres,
   requires = IS_IN_DB(db,'adres.id')))

db.inwoner.adres.represent = lambda id: db.adres(id).straat

Why does represent not represent  inwoner.adres as 'straat' from 'adres?

Regards
Johann
-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] Re: Rails vulnerability issue (are we protected?)

2011-02-12 Thread Massimo Di Pierro
I need to understand better Rails mechanism to understand what broke
there. We do not use http headers to protect against CSRF, we use a
one time uuid hidden in the forms.


[web2py] Re: Apache, Wsgi problem

2011-02-12 Thread Massimo Di Pierro
In any case, please check whether upgrading postgresql for you solves
the problem. It is possible that mysqldb has/had the same issue.

I am very skeptical this is a web2py issue. So we should try isolate
the problem.

Massimo

On Feb 12, 12:12 am, Anthony  wrote:
> On Saturday, February 12, 2011 1:03:48 AM UTC-5, Jonathan Lundell wrote:
>
> > On Feb 10, 2011, at 6:19 AM, Massimo Di Pierro wrote:
>
> > > I offer $300 to whoever can identify within 3 weeks and without
> > > ambiguity the cause of this problem. The bounty applies even if the
> > > problem turns out to be not in web2py but in one of the Python
> > > modules, in Apache or in the mod_wsgi implementation. It does not
> > > apply if the problem is due to known bug that has already been fixed
> > > by the responsible party (for example if you are using an old un-
> > > patched python version like 2.5.0 or an old mod_wsgi version).
>
> > psycopg2 2.0.7 is the version in use in this case. 2.0.8 had this in the
> > change log:
>
> > > * psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs
> > >         without holding the GIL.
>
> > Suggestive, no? There's some evidence on the web that this may have led to
> > "Segmentation fault - premature end of script headers" errors.
>
> > 2.3.2 is current
>
> Though someone reported the same problem with 
> MySQL:https://groups.google.com/d/msg/web2py/AcCDl5eJnds/AXNyKO6kmBwJ


Re: [web2py] Re: New web2py logo? [just for fun]

2011-02-12 Thread Anthony
On Saturday, February 12, 2011 3:59:01 AM UTC-5, Marin Pranjic wrote: 
>
> I set it as a wallpaper on my mobile, hope your daughter won't mind :)

 
I'm sure that will make her very happy.


[web2py] Re: new support platform for web2py - make money

2011-02-12 Thread Francisco Costa
Hi Ovideo.. English please :)
The coding is not finished yet

On Feb 12, 11:53 am, Ovidio Marinho  wrote:
> Francisco voce pode disponibilizar o codigo para podermos ver as novidades
> que vc colocou nesta app, tipo campos arredondados , icones e etc...
>
> 2011/2/11 Francisco Costa 
>
>
>
>
>
>
>
>
>
> > Hello!
> > During the past months I'm using a lot web2py.
> > I've been asking a few questions here in this group and I've received
> > help from people all around the world. Sometimes I really felt like I
> > should give back something to those kind souls..
>
> > So that's why in the past 2 days I've createdhttp://askvalue.com/
> > (using web2py).
> > This is alpha version, and I would like your feedback.
>
> > AskValue aims to be a social platform of questions and answers where
> > you can make money by doing a valuable question/comment or by
> > providing quality answers.
>
> > How do you win money? You must have a Flattr.com account (optional)
> > and create a "thing" with your site profile:
> >http://askvalue.com/user/username
>
> > If the user gives you credit I believe that you will be flattred (make
> > money)
> > If you register you can follow your friends, and receive their updates
> > (dashboard under construction).. or you can only follow questions of
> > your interest.
> > You can also vote on your favorite answers!
>
> > I'm also planning to implement during the next week email-
> > notifications.
>
> > I think that this kind of service can encourages users to help more!
> > I also believe that Google Groups is very limited and old-fashionable
> > for support, and with this you can have a much richer experience.
>
> > Please help me by providing me your honest feedback.
> > and please don't mock on my design skills.. I need more time for it :)
>
> --
>         Ovidio Marinho Falcao Neto
>              ovidio...@gmail.com
>          Tecnologia da Informaçao
>          Casa Civil do Governador
>          83 3214 7885 - 88269088
>                   Paraiba


[web2py] Re: web2py not using global http_proxy

2011-02-12 Thread whowhywhat
Luis i did use the web2py auto config script to try out apache with
WSGI.
I too noticed that apache seems to hog memory (as compared to
cherokee). I think Cherokee is a great web server as its documentation
is really good.
I will surely document how i set up Cherokee + WSGI + web2py and post
it here or on the web2py wiki.
i was seeing a total memory consumption of under 150MB with Cherokee,
WSGI and web2py (4 WSGI processes)
i have done this on my work machine (running turnkey Linux (based on
Ubuntu 10.04) in a virtualbox). i will document and post what i have
done on Monday (14th feb 2010)

On Feb 12, 6:10 pm, Luis Díaz  wrote:
> I'm using a virtualization solution. (Proxmox)
>
> I have a debian server 5,
> installed by minimal changes in the script
> "Setup web2py + apache + ssl + mod_wsgi + postgresql in FEW seconds"
> I do not use postgresql on this server.
>
> I have another server with debian virtualized 5 and in this I have
> configured to allow external connections postgresql
>
> I noticed a 638Mb memory consumption on the first server without
> ejecutandoce web2py applications.
>
> could comment as configurastes web2py and Cherokee
>
> I want to lose the memory consumption and increase performance.
>
> 2011/2/12 whowhywhat 
>
>
>
>
>
>
>
>
>
> > Thanks for the quick replies.
> > As Luis mentions i have used export http_proxy (but in /etc/
> > environment and in the startup script of cherokee). I will try
> > defining in /etc/profile
> > i did some further testing by launching web2py with its own web
> > server.
> > by running "python web2py.py -c server.crt -k server.key -a password -
> > i  -p "
> > This way web2py uses the proxy seamlessly (It works fine!)
>
> > but when i deploy using wsgi either in apache or cherokee web2py does
> > not see the proxy. what could be wrong? where is this problem
> > occurring?
>
> > Luis .. which is the web server and cgi setup you are using?
>
> > i am really impressed with the speed of cherokee + wsgi + web2py, the
> > memory foot print is small and the whole thing runs like greased
> > lightning :D .. i just hope to solve this proxy issue.
>
> > On Feb 11, 10:50 pm, Luis Díaz  wrote:
> > > I forgot.
> > > if you need to specify username and password
> > > then the structure would be something.
>
> > > export http_proxy =http://username:password@proxy:port/
> > > export https_proxy =http://username:password@proxy:port/
> > > export ftp_proxy =http://username:password@proxy:port/
>
> > > 2011/2/11 Luis Díaz 
>
> > > > Greetings,
> > > > web2py I mention that I use in my work.
> > > > and we have a proxy that we restrict the output
> > > > by user name and password
>
> > > > I have solved the problem properly configuring the proxy on the
> > computer
> > > > where I have installed debian web2py
>
> > > > nano /etc/profile
>
> > > > adding the following lines:
>
> > > > export http_proxy =http://proxy.uc.edu.ve:5010/
> > > > export https_proxy =http://proxy.uc.edu.ve:5010/
> > > > export ftp_proxy =http://proxy.uc.edu.ve:5010/
>
> > > > 2011/2/11 Massimo Di Pierro 
>
> > > > Thanks for your comments.
>
> > > >> WHen you need urllib, and web2py.python makes outbound connections you
> > > >> should not need a proxy server or any proxy configuration as far as I
> > > >> can tell (and I am not sure about your setup). This looks more of a
> > > >> firewall issue.
>
> > > >> On Feb 11, 5:19 am, whowhywhat  wrote:
> > > >> > web2py is the first framework i actually enjoy using. :) .. been
> > > >> > advocating it to everyone i meet these days. I sincerely thank the
> > > >> > entire web2py community for everything.
>
> > > >> > I have been developing a small web2py application for intranet use
> > at
> > > >> > the place where i work. During development i used windows (i carry
> > > >> > web2py on a thumb drive). At work we use a proxy for net access and
> > in
> > > >> > windows i have no problems with web2py accessing the net using the
> > > >> > proxy.
> > > >> > I can use urllib to fetch webpages etc.
>
> > > >> > To deploy the app i am using Ubuntu. I have deployed web2py using
> > both
> > > >> > apache as well as Cherokee using WSGI. The application runs fine.
> > > >> > however the web2py environment is not able to fetch anything from
> > the
> > > >> > internet. urllib does not fetch any webpages. I have explicitly set
> > > >> > the http_proxy environment variable (in /etc/environment, in the
> > > >> > Cherokee startup script). I need to fetch data from the web, mostly
> > > >> > for openID authentication. I am not sure what's wrong.
>
> > > >> > how can i make web2py/python use the proxy server (http_proxy)?
>
> > > > --
> > > > Díaz Luis
> > > > TSU Analisis de Sistemas
> > > > Universidad de Carabobo
>
> > > > Facultad de Odontología<
> >http://www.odontologia.uc.edu.ve/index.php?option=com_content&view=ar...>
>
> > > --
> > > Díaz Luis
> > > TSU Analisis de Sistemas
> > > Universidad de Carabobo
>
> > > Facultad de Odontología<
> >http://www.odontolog

Re: [web2py] Re: Apache, Wsgi problem

2011-02-12 Thread Jonathan Lundell
On Feb 11, 2011, at 10:12 PM, Anthony wrote:
> On Saturday, February 12, 2011 1:03:48 AM UTC-5, Jonathan Lundell wrote:
> On Feb 10, 2011, at 6:19 AM, Massimo Di Pierro wrote:
> > 
> > I offer $300 to whoever can identify within 3 weeks and without
> > ambiguity the cause of this problem. The bounty applies even if the
> > problem turns out to be not in web2py but in one of the Python
> > modules, in Apache or in the mod_wsgi implementation. It does not
> > apply if the problem is due to known bug that has already been fixed
> > by the responsible party (for example if you are using an old un-
> > patched python version like 2.5.0 or an old mod_wsgi version).
> psycopg2 2.0.7 is the version in use in this case. 2.0.8 had this in the 
> change log:
> 
> > * psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs
> > without holding the GIL.
> 
> 
> Suggestive, no? There's some evidence on the web that this may have led to 
> "Segmentation fault - premature end of script headers" errors.
> 
> 2.3.2 is current
> 
> Though someone reported the same problem with MySQL: 
> https://groups.google.com/d/msg/web2py/AcCDl5eJnds/AXNyKO6kmBwJ
>  

Part of the problem is that this is a very general error. Lots of things can 
cause a segmentation fault of the wsgi request thread, which in turn leads to 
that message. Psycopg2 2.0.7 may well have a problem that causes it, and there 
may well be other ways for it to happen as well. It's important to eliminate 
the known problems (like this one) so that if another fault comes along, we 
know it's something else.

Unfortunately we can't carry these adapters along in web2py, since they're not 
pure/portable Python.



Re: [web2py] Re: What is the convention for using web2py/site-packages for GAE?

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 3:12 AM, Carl wrote:
> 
> I've avoided editing oauth10a_account.py by moving the directory
> oauth2 to web2py (and keeping httplib2 inside oauth2.
> 
> Not happy that I've put this in Web2py's root but I've avoided editing
> the framework source and don't need to worry about overwriting files
> when I upgrade Web2py.
> 
> On Feb 11, 1:46 pm, Carl  wrote:
>> I'm using OAuth/LinkedIn on GAE.
>> 
>> To get oauth/LinkedIn to run on dev_appserver/GAE I had to copy
>> directory oauth2 from web2py/site-packages to web2py/gluon/contrib and
>> httplib2 from site-packages to web2py/gluon/contrib/oauth2
>> 
>> Then in oauth10a_account.py change "import oauth2 as oauth" to "import
>> gluon.contrib.oauth2 as oauth".
>> 
>> Bingo.
>> 
>> But.. is there a convention that will make web2py upgrades
>> straightforward?

Two questions:

1. What web2py version are you using?

B. What happens when oauth2 is in site-packages?

3. Where is your import? (OK, three questions.)

Recently (and I'll have to do some research to find out exactly when), we made 
some changes in this area. It used to be that the handling of web2py's 
additions to sys.path were somewhat erratic, and dependent on which handler was 
in use. The changes were to make it consistent across handlers. In particular 
(at least in the trunk), both the web2py root and site-packages should be at 
the beginning of sys.path by the time you do your import.

Could you please log sys.path at the time you do your import (or save a copy 
and display it later)? Thanks.

Re: [web2py] Re: Apache, Wsgi problem

2011-02-12 Thread Luis Díaz
Greetings.

I could create a web2py.app.error.w2p

and detail the specifications of the environment,
I will try to put him eye to the issue.


I am a rookie .. but I would try

Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo

Facultad de 
Odontología





2011/2/12 Jonathan Lundell 

> On Feb 11, 2011, at 10:12 PM, Anthony wrote:
>
> On Saturday, February 12, 2011 1:03:48 AM UTC-5, Jonathan Lundell wrote:
>>
>> On Feb 10, 2011, at 6:19 AM, Massimo Di Pierro wrote:
>> >
>> > I offer $300 to whoever can identify within 3 weeks and without
>> > ambiguity the cause of this problem. The bounty applies even if the
>> > problem turns out to be not in web2py but in one of the Python
>> > modules, in Apache or in the mod_wsgi implementation. It does not
>> > apply if the problem is due to known bug that has already been fixed
>> > by the responsible party (for example if you are using an old un-
>> > patched python version like 2.5.0 or an old mod_wsgi version).
>>
>> psycopg2 2.0.7 is the version in use in this case. 2.0.8 had this in the
>> change log:
>>
>> > * psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs
>> > without holding the GIL.
>>
>>
>> Suggestive, no? There's some evidence on the web that this may have led to
>> "Segmentation fault - premature end of script headers" errors.
>>
>> 2.3.2 is current
>>
> Though someone reported the same problem with MySQL:
> https://groups.google.com/d/msg/web2py/AcCDl5eJnds/AXNyKO6kmBwJ
>
>
>
> Part of the problem is that this is a very general error. Lots of things
> can cause a segmentation fault of the wsgi request thread, which in turn
> leads to that message. Psycopg2 2.0.7 may well have a problem that causes
> it, and there may well be other ways for it to happen as well. It's
> important to eliminate the known problems (like this one) so that if another
> fault comes along, we know it's something else.
>
> Unfortunately we can't carry these adapters along in web2py, since they're
> not pure/portable Python.
>
>


Re: [web2py] Re: Apache, Wsgi problem

2011-02-12 Thread ron_m
FWIW I am on Ubuntu 10.04 with all patches applied and could not reproduce 
the above problem when I tried. The version of python-psycopg2 from the 
standard repository is 2.0.13. Not an iron-clad guarantee because something 
else could be at play but at least a data point. I also drove the 
application a lot harder from ab with 10x number of requests to try and 
reproduce but still nothing.

The fact it doesn't fail when processes=5 and threads=1 agrees well with the 
GIL problem - without threads there is no need to hold the GIL.


[web2py] Re: recommended ERP system?

2011-02-12 Thread Carlos
Thanks very much for your recommendation !

[web2py] plugin_wiki Menu (active flag)

2011-02-12 Thread G. Clifford Williams

I'm playing around with plugin_wiki and can't seem to figure out how to set a 
menu item's "active flag" if it infact corresponds to the page that's being 
accessed. 

Any ideas

TIA

--Cliff


Re: [web2py] Re: Apache, Wsgi problem

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 8:33 AM, Luis Díaz wrote:
> I could create a web2py.app.error.w2p
> 
> and detail the specifications of the environment,
> I will try to put him eye to the issue.
> 
> 
> I am a rookie .. but I would try
> 

Thanks, Luis.

Re: [web2py] Re: Apache, Wsgi problem

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 8:46 AM, ron_m wrote:
> FWIW I am on Ubuntu 10.04 with all patches applied and could not reproduce 
> the above problem when I tried. The version of python-psycopg2 from the 
> standard repository is 2.0.13. Not an iron-clad guarantee because something 
> else could be at play but at least a data point. I also drove the application 
> a lot harder from ab with 10x number of requests to try and reproduce but 
> still nothing.
> 
> The fact it doesn't fail when processes=5 and threads=1 agrees well with the 
> GIL problem - without threads there is no need to hold the GIL.

Yes, it's a useful data point.

The best test will be to have an environment that actually fails with psycopg2 
2.0.7, and have the failure disappear with an updated version (and no other 
changes), and to get the error back again with 2.0.7.

[web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread Jonathan Lundell
Is there a trick to getting web2py to run locally with the GAE Launcher? (OS X 
FWIW)

I'm playing with the stock stable release. It works fine when deployed, but not 
locally (immediate ticket, and I don't know how to find the ticket).

Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
On Sat, Feb 12, 2011 at 09:20:02AM -0800, Jonathan Lundell spake:
> Is there a trick to getting web2py to run locally with the GAE Launcher? (OS 
> X FWIW)
> 
> I'm playing with the stock stable release. It works fine when deployed, but 
> not locally (immediate ticket, and I don't know how to find the ticket).

web2py tickets are generated as datastore objects. You won't be able to search 
the datastore for objects until it's been seeded (which just means that 
something has to be there before you can search for it). To view the tickets go 
to: http://localhost:[port]/_ah/admin/datastore

there you will see a dropdown list for "Entity Kind" select the one labeled 
web2py_ticket_[appname] then click 'list entries'. These are your tickets


I hope that helps





Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 9:29 AM, G. Clifford Williams wrote:
> 
> On Sat, Feb 12, 2011 at 09:20:02AM -0800, Jonathan Lundell spake:
>> Is there a trick to getting web2py to run locally with the GAE Launcher? (OS 
>> X FWIW)
>> 
>> I'm playing with the stock stable release. It works fine when deployed, but 
>> not locally (immediate ticket, and I don't know how to find the ticket).
> 
> web2py tickets are generated as datastore objects. You won't be able to 
> search the datastore for objects until it's been seeded (which just means 
> that something has to be there before you can search for it). To view the 
> tickets go to: http://localhost:[port]/_ah/admin/datastore
> 
> there you will see a dropdown list for "Entity Kind" select the one labeled 
> web2py_ticket_[appname] then click 'list entries'. These are your tickets
> 
> 
> I hope that helps

Got it; thanks.

Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 9:29 AM, G. Clifford Williams wrote:
> 
> On Sat, Feb 12, 2011 at 09:20:02AM -0800, Jonathan Lundell spake:
>> Is there a trick to getting web2py to run locally with the GAE Launcher? (OS 
>> X FWIW)
>> 
>> I'm playing with the stock stable release. It works fine when deployed, but 
>> not locally (immediate ticket, and I don't know how to find the ticket).
> 
> web2py tickets are generated as datastore objects. You won't be able to 
> search the datastore for objects until it's been seeded (which just means 
> that something has to be there before you can search for it). To view the 
> tickets go to: http://localhost:[port]/_ah/admin/datastore
> 
> there you will see a dropdown list for "Entity Kind" select the one labeled 
> web2py_ticket_[appname] then click 'list entries'. These are your tickets
> 
> 
> I hope that helps

Also, I see that the Launcher's SDK Console toolbar button takes me there; I 
just didn't know what I was looking for.

FWIW, I'm seeing this:

S'Traceback (most recent call last):\n  
File "/Users/jlundell/Projects/GAE/welcome/gluon/restricted.py", line 188, in 
restricted\nexec ccode in environment\n 
File 
"/Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket",
 line 1159, in \n  
File "/Users/jlundell/Projects/GAE/welcome/gluon/globals.py", line 95, in 
\nself._caller = lambda f: f()\n  
File 
"/Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket",
 line 1124, in ticket\n  
File "/Users/jlundell/Projects/GAE/welcome/gluon/restricted.py", line 162, in 
load\nself.layer = d[\'layer\']\nTypeError: \'NoneType\' object is 
unsubscriptable\n'

...which looks like an error loading a ticket, unfortunately.

Re: [web2py] Re: Apache, Wsgi problem

2011-02-12 Thread Luis Díaz
Translation error .. sorry.

I could not ..
might wonder if any of you?

Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo

Facultad de 
Odontología





2011/2/12 Jonathan Lundell 

> On Feb 12, 2011, at 8:46 AM, ron_m wrote:
> > FWIW I am on Ubuntu 10.04 with all patches applied and could not
> reproduce the above problem when I tried. The version of python-psycopg2
> from the standard repository is 2.0.13. Not an iron-clad guarantee because
> something else could be at play but at least a data point. I also drove the
> application a lot harder from ab with 10x number of requests to try and
> reproduce but still nothing.
> >
> > The fact it doesn't fail when processes=5 and threads=1 agrees well with
> the GIL problem - without threads there is no need to hold the GIL.
>
> Yes, it's a useful data point.
>
> The best test will be to have an environment that actually fails with
> psycopg2 2.0.7, and have the failure disappear with an updated version (and
> no other changes), and to get the error back again with 2.0.7.


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
1) can you paste your app.yaml/

2)  you should have some code like this in your main model file:
if request.env.web2py_runtime_gae:# if running on Google App 
Engine
db = DAL('gae')   # connect to Google BigTable
session.connect(request, response, db=db) # and store sessions and 
tickets th
else: # else use a normal 
relational database
db = DAL('sqlite://gripez.db') 

3) you probably want to link 'applications/your_app_name' to 'init' or use one 
of the other remedies for having your app be the default. More info here: 
http://web2py.com/book/default/chapter/04#Application-init

On Sat, Feb 12, 2011 at 09:43:08AM -0800, Jonathan Lundell spake:
> On Feb 12, 2011, at 9:29 AM, G. Clifford Williams wrote:
> > 
> > On Sat, Feb 12, 2011 at 09:20:02AM -0800, Jonathan Lundell spake:
> >> Is there a trick to getting web2py to run locally with the GAE Launcher? 
> >> (OS X FWIW)
> >> 
> >> I'm playing with the stock stable release. It works fine when deployed, 
> >> but not locally (immediate ticket, and I don't know how to find the 
> >> ticket).
> > 
> > web2py tickets are generated as datastore objects. You won't be able to 
> > search the datastore for objects until it's been seeded (which just means 
> > that something has to be there before you can search for it). To view the 
> > tickets go to: http://localhost:[port]/_ah/admin/datastore
> > 
> > there you will see a dropdown list for "Entity Kind" select the one labeled 
> > web2py_ticket_[appname] then click 'list entries'. These are your tickets
> > 
> > 
> > I hope that helps
> 
> Also, I see that the Launcher's SDK Console toolbar button takes me there; I 
> just didn't know what I was looking for.
> 
> FWIW, I'm seeing this:
> 
> S'Traceback (most recent call last):\n  
> File "/Users/jlundell/Projects/GAE/welcome/gluon/restricted.py", line 188, in 
> restricted\nexec ccode in environment\n 
> File 
> "/Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket",
>  line 1159, in \n  
> File "/Users/jlundell/Projects/GAE/welcome/gluon/globals.py", line 95, in 
> \nself._caller = lambda f: f()\n  
> File 
> "/Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket",
>  line 1124, in ticket\n  
> File "/Users/jlundell/Projects/GAE/welcome/gluon/restricted.py", line 162, in 
> load\nself.layer = d[\'layer\']\nTypeError: \'NoneType\' object is 
> unsubscriptable\n'
> 
> ...which looks like an error loading a ticket, unfortunately.


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 10:10 AM, G. Clifford Williams wrote:
> 
> 1) can you paste your app.yaml/

application: jkl-web2py-welcome
version: 5
api_version: 1
runtime: python

derived_file_type:
- python_precompiled

handlers:

- url: /_ah/stats.*
  script: $PYTHON_LIB/google/appengine/ext/appstats/ui.py
  login: admin
 
- url: /(?P.+?)/static/(?P.+)
  static_files: applications/\1/static/\2
  upload: applications/(.+?)/static/(.+)
  secure: optional
  expiration: "90d"

- url: /_ah/admin/.*
  script: $PYTHON_LIB/google/appengine/ext/admin
  login: admin
 
- url: /_ah/queue/default
  script: gaehandler.py
  login: admin

- url: .*
  script: gaehandler.py  
  secure: optional

admin_console:
  pages:
  - name: Appstats
url: /_ah/stats
   
skip_files: |
 ^(.*/)?(
 (app\.yaml)|
 (app\.yml)|
 (index\.yaml)|
 (index\.yml)|
 (#.*#)|
 (.*~)|
 (.*\.py[co])|
 (.*/RCS/.*)|
 (\..*)|
 ((admin|examples|welcome)\.(w2p|tar))|
 (applications/.*?/(cron|databases|errors|cache|sessions)/.*)|
 ((logs|scripts)/.*)|
 (anyserver\.py)|
 (web2py\.py)|
 ((cgi|fcgi|modpython|wsgi)handler\.py)|
 (epydoc\.(conf|css))|
 (httpserver\.log)|
 (logging\.example\.conf)|
 (routes\.example\.py)|
 (setup_(app|exe)\.py)|
 (splashlogo\.gif)|
 (parameters_\d+\.py)|
 (options_std.py)|
 (gluon/tests/.*)|
 (gluon/rocket\.py)|
 (gluon/winservice\.py)|
 (.*\.(bak|orig))|
 )$

builtins:
- remote_api: on
- datastore_admin: on



> 
> 2)  you should have some code like this in your main model file:
>if request.env.web2py_runtime_gae:# if running on Google App 
> Engine
>db = DAL('gae')   # connect to Google BigTable
>session.connect(request, response, db=db) # and store sessions and 
> tickets th
>else: # else use a normal 
> relational database
>db = DAL('sqlite://gripez.db') 

For now, it's just the stock welcome app, so it has that logic.

And it works OK when deployed to GAE; it's just running it locally that breaks.

> 3) you probably want to link 'applications/your_app_name' to 'init' or use 
> one of the other remedies for having your app be the default. More info here: 
> http://web2py.com/book/default/chapter/04#Application-init

Being welcome, it's the default in the absence of an app named init.

> 
> On Sat, Feb 12, 2011 at 09:43:08AM -0800, Jonathan Lundell spake:
>> On Feb 12, 2011, at 9:29 AM, G. Clifford Williams wrote:
>>> 
>>> On Sat, Feb 12, 2011 at 09:20:02AM -0800, Jonathan Lundell spake:
 Is there a trick to getting web2py to run locally with the GAE Launcher? 
 (OS X FWIW)
 
 I'm playing with the stock stable release. It works fine when deployed, 
 but not locally (immediate ticket, and I don't know how to find the 
 ticket).
>>> 
>>> web2py tickets are generated as datastore objects. You won't be able to 
>>> search the datastore for objects until it's been seeded (which just means 
>>> that something has to be there before you can search for it). To view the 
>>> tickets go to: http://localhost:[port]/_ah/admin/datastore
>>> 
>>> there you will see a dropdown list for "Entity Kind" select the one labeled 
>>> web2py_ticket_[appname] then click 'list entries'. These are your tickets
>>> 
>>> 
>>> I hope that helps
>> 
>> Also, I see that the Launcher's SDK Console toolbar button takes me there; I 
>> just didn't know what I was looking for.
>> 
>> FWIW, I'm seeing this:
>> 
>> S'Traceback (most recent call last):\n  
>> File "/Users/jlundell/Projects/GAE/welcome/gluon/restricted.py", line 188, 
>> in restricted\nexec ccode in environment\n 
>> File 
>> "/Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket",
>>  line 1159, in \n  
>> File "/Users/jlundell/Projects/GAE/welcome/gluon/globals.py", line 95, in 
>> \nself._caller = lambda f: f()\n  
>> File 
>> "/Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket",
>>  line 1124, in ticket\n  
>> File "/Users/jlundell/Projects/GAE/welcome/gluon/restricted.py", line 162, 
>> in load\nself.layer = d[\'layer\']\nTypeError: \'NoneType\' object is 
>> unsubscriptable\n'
>> 
>> ...which looks like an error loading a ticket, unfortunately.




[web2py] Re: New web2py logo? [just for fun]

2011-02-12 Thread Massimo Di Pierro
We could use Martin's app for logo's submission and disable the voting
part.

On Feb 12, 9:42 am, Anthony  wrote:
> On Saturday, February 12, 2011 3:59:01 AM UTC-5, Marin Pranjic wrote:
>
> > I set it as a wallpaper on my mobile, hope your daughter won't mind :)
>
> I'm sure that will make her very happy.


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
On Sat, Feb 12, 2011 at 10:28:52AM -0800, Jonathan Lundell spake:
> On Feb 12, 2011, at 10:10 AM, G. Clifford Williams wrote:
> > 
> > 1) can you paste your app.yaml/
> 
*snip*
> 
> builtins:
> - remote_api: on
> - datastore_admin: on
> 
> > 
> > 2)  you should have some code like this in your main model file:
> >if request.env.web2py_runtime_gae:# if running on Google App 
> > Engine
> >db = DAL('gae')   # connect to Google 
> > BigTable
> >session.connect(request, response, db=db) # and store sessions and 
> > tickets th
> >else: # else use a normal 
> > relational database
> >db = DAL('sqlite://gripez.db') 
> 
> For now, it's just the stock welcome app, so it has that logic.
> 
> And it works OK when deployed to GAE; it's just running it locally that 
> breaks.
> 
> > 3) you probably want to link 'applications/your_app_name' to 'init' or use 
> > one of the other remedies for having your app be the default. More info 
> > here: http://web2py.com/book/default/chapter/04#Application-init
> 
> Being welcome, it's the default in the absence of an app named init.
> 

If it's the stock app (unmodified in anyway) and you just added it to the GAE 
then when you go to http://localhost:[port]/ you should see "Hello World"

What version of web2py are you trying this with? I've just confirmed this with 
my install of 1.91.6


*snip*


[web2py] Re: form.accepts() with reference to other table

2011-02-12 Thread villas
Not sure, but the 3rd attrib of 'IS_IN_DB' doesn't look right?

Maybe if you tried something like this, e.g.
custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,'%
(name)s')


On Feb 12, 1:28 pm, Oskari  wrote:
> Hi!
>
> I'm having trouble making an insert with form.accepts()
>
> Currently I have a custom auth_user that has one extra field:
> Field('accountID', db.accounts) with
> custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,id)
>
> While trying to modify variables it fails with "not found in db"
>
> def func():
>     form=SQLFORM(db.auth_user)
>     request.vars.accountID = 1
>     if form.accepts(request.vars,session):
>         response.flash = "Succesfully created user"
>     return dict(form=form)
>
> Why does not form.accepts() recognize and accept my accountID?


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 10:37 AM, G. Clifford Williams wrote:
> 
> If it's the stock app (unmodified in anyway) and you just added it to the GAE 
> then when you go to http://localhost:[port]/ you should see "Hello World"
> 
> What version of web2py are you trying this with? I've just confirmed this 
> with my install of 1.91.6

I think I must have fat-fingered something. I reinstalled 1.91.6 and it works 
fine now.

Thanks.



Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
On Sat, Feb 12, 2011 at 11:11:16AM -0800, Jonathan Lundell spake:
> On Feb 12, 2011, at 10:37 AM, G. Clifford Williams wrote:
> > 
> > If it's the stock app (unmodified in anyway) and you just added it to the 
> > GAE then when you go to http://localhost:[port]/ you should see "Hello 
> > World"
> > 
> > What version of web2py are you trying this with? I've just confirmed this 
> > with my install of 1.91.6
> 
> I think I must have fat-fingered something. I reinstalled 1.91.6 and it works 
> fine now.
> 
> Thanks.
> 

Awesome.. I'm glad to hear it


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread feric...@gmail.com
Thanks, I only wanted to see if it just me having this problem. It is not so
important to run it with dev_appserver.py.

On Sun, Feb 13, 2011 at 12:06 AM, Jonathan Lundell wrote:

> On Feb 12, 2011, at 1:45 PM, feric...@gmail.com wrote:
>
> I'm running the latest version of gae 1.4.2 and latest version of web2py.
> It didn't work for me on mac so I am trying it on linux now. It works if I
> deploy it.
>
> Does it work out of the box for you?
>
>
> I've been fighting similar problems on OS X. The short answer seems to be:
> point the SDK at Python 2.5. The symptoms are sort of erratic, but a long
> stack trace that ends in a failure to import some shared C library is what
> I've been seeing: _io or _ctypes so far.
>
> A small point: in the GAE SDK GUI (GoogleAppEngineLauncher) you can set the
> Python version as a Preference (point it to the python binary). But in the
> Preference field, you have to hit Enter, or it doesn't stick.
>
> I'm running Launcher version 1.4.2.1041
>
> I happen to have Python 2.5.4 lying around, and that seems to work, so far.
> 2.5.2 is here if you want it:
> http://www.python.org/download/releases/2.5.2/
>
>
>
> On Sat, Feb 12, 2011 at 11:41 PM, G. Clifford Williams <
> g...@notadiscussion.com> wrote:
>
>> On Sat, Feb 12, 2011 at 01:33:00PM -0800, rif spake:
>> > Shoud these steps work?
>> >
>> > - download google app engine
>> > - download web2py
>> > - run ./dev_appserver.py ../web2py/
>> > - go to http://localhost:8080
>> >
>> > Should it display the welcome app?
>> > I am on a fedora system with python 2.7 and it doesn't (it gives me an
>> long
>> > stacktrace). Is it because of python version?
>>
>> Depends on the version of GAE you're running. Support for python 2.7 was
>> added very recently and may still be beta (not sure on this).
>>
>> I've never used GAE SDK on Linux so I'm not sure how it works there. On OS
>> X you start the GAE Launcher and add your application to the launcher via a
>> gui then start it by clicking on a run button.
>>
>
>
>
>


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 1:41 PM, G. Clifford Williams wrote:
> 
> Depends on the version of GAE you're running. Support for python 2.7 was 
> added very recently and may still be beta (not sure on this).

http://code.google.com/appengine/docs/roadmap.html

On it's way, apparently.

Good to know.

[web2py] When is db.commit() unnecessary?

2011-02-12 Thread Dane
Hello, wondering if someone could clarify when it's unnecessary to
call db.commit()? I've noticed it is needed when doing inserts from
the console, but it seems to be implicit in controller functions? Just
looking for some quick clarification on this. Thanks!


[web2py] Re: form.accepts() with reference to other table

2011-02-12 Thread Oskari
Thank you for your answer villas!

I don't think that is the problem. I am able to make inserts through
the appadmin-site, but somehow it fails with form.accepts().
I also tried what you suggested, but could not quite get it working.

On Feb 12, 8:45 pm, villas  wrote:
> Not sure, but the 3rd attrib of 'IS_IN_DB' doesn't look right?
>
> Maybe if you tried something like this, e.g.
> custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,'%
> (name)s')
>
> On Feb 12, 1:28 pm, Oskari  wrote:
>
>
>
>
>
>
>
> > Hi!
>
> > I'm having trouble making an insert with form.accepts()
>
> > Currently I have a custom auth_user that has one extra field:
> > Field('accountID', db.accounts) with
> > custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,id)
>
> > While trying to modify variables it fails with "not found in db"
>
> > def func():
> >     form=SQLFORM(db.auth_user)
> >     request.vars.accountID = 1
> >     if form.accepts(request.vars,session):
> >         response.flash = "Succesfully created user"
> >     return dict(form=form)
>
> > Why does not form.accepts() recognize and accept my accountID?


[web2py] Re: When is db.commit() unnecessary?

2011-02-12 Thread Massimo Di Pierro
every http request works like this:

try:
   run all models
   run controller function
   run view
   commit all open trasactions
except:
   rollback all open transactions

So in models, controllers and views only you need to db.commit() if
you want to commit despite possible uncaught exceptions later in the
same actions.

If you use DAL in a script you always need to do db.commit()

On Feb 12, 4:19 pm, Dane  wrote:
> Hello, wondering if someone could clarify when it's unnecessary to
> call db.commit()? I've noticed it is needed when doing inserts from
> the console, but it seems to be implicit in controller functions? Just
> looking for some quick clarification on this. Thanks!


[web2py] Web2py in combination with mod_python

2011-02-12 Thread Grezly
I'm trying now for a few days to get web2py working with mod_python
(on a shared hosting). Because i have no other options of configuring
apache or anything else.

I did find a small tutorial on how to configure web2py with
mod_python. (http://www.web2py.com/AlterEgo/default/show/231).

So far i have the following:
.htaccess
===
SetHandler python-program
PythonHandler web2py_modpython
PythonPath "['/path/to/web2py/public_html/'] + sys.path"
PythonDebug On
SetEnv SITE_URL '/welcome'

I've also downloaded the web2py_modpython.py.
At first i had some problems with req.subprocess_env['SITE_URL']  in
web2py_modpython.py but found out that setting the enviroment variable
did solve the problem.
So right now i have set the SITE_URL by hand to 'welcome', which
workes, but only for the application. The static files aren't served.
(I only get the text back, links

I did read something that i have to use mod_rewrite, but can't find
information about this specific for web2py.
Does someone has the basic of web2py working with mod_python/apache?
Did i miss something to set? Or did i misconfigure something?


Re: [web2py] Re: New web2py logo? [just for fun]

2011-02-12 Thread Albert Abril
Is thist the begginning of something like art.web2py.com ?
:)

On Sat, Feb 12, 2011 at 7:36 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> We could use Martin's app for logo's submission and disable the voting
> part.
>
> On Feb 12, 9:42 am, Anthony  wrote:
> > On Saturday, February 12, 2011 3:59:01 AM UTC-5, Marin Pranjic wrote:
> >
> > > I set it as a wallpaper on my mobile, hope your daughter won't mind :)
> >
> > I'm sure that will make her very happy.
>


[web2py] Re: Help me with the coding for making a table

2011-02-12 Thread DenesL
This seems to work:

def absent_form():
  header=['roll', 'name', 'absent']
  data=[['1', ''], ['2', ''], ['3', ''], ['4', '']]
  head=THEAD(TR( *[TH(x) for x in header[:-1]] + \
[TH((DIV(header[-1]), \
  DIV(LABEL("(", \
INPUT(_name="absentall",_type="checkbox",_value="all")), \
"All)")))]))
  body=TBODY(*[row + \
[INPUT(_name="absent",_type="checkbox",_value="%s"%row[0]) ] \
for row in data ])
  f=FORM(TABLE(head,body,_border="1",_width="200"), \
 INPUT(_type="submit",_value="submit"))
  if request.vars.absentall:
# do something when absentall ="all" & redirect
print request.vars.absentall
  if request.vars.absent:
# request.vars.absent can be a single value
# or a list, process & redirect
print request.vars.absent
  return dict(f=f)

You are going to need a cancel button to leave the form without any
input.


On Feb 11, 10:48 pm, Rupesh Pradhan  wrote:
> I want using the data below, generate a table:
>
> header=['roll', 'name', 'absent']
>
> data=[['1', ''], ['2', ''], ['3', ''], ['4', '']]
>
> 
> 
> Roll
> Name
> Absent
> 
> (
> 
> 
> All)
> 
> 
> 
> 1
> 
> 
> 
> 
> 
> 
> 2
> 
> 
> 
> 
> 3
> 
> 
> 
> 
> 4
> 
> 
> 
>
> 
> 
> 


[web2py] Re: new support platform for web2py - make money

2011-02-12 Thread DenesL
Interesting idea Francisco.

Besides Q&A, there can also be a chipin process towards a request,
where people would add to the pot until somebody agrees to do the
work, the pot can be on consignment until delivered and still be open
for more contributions.


On Feb 11, 2:45 pm, Francisco Costa  wrote:
> Hello!
> During the past months I'm using a lot web2py.
> I've been asking a few questions here in this group and I've received
> help from people all around the world. Sometimes I really felt like I
> should give back something to those kind souls..
>
> So that's why in the past 2 days I've createdhttp://askvalue.com/
> (using web2py).
> This is alpha version, and I would like your feedback.
>
> AskValue aims to be a social platform of questions and answers where
> you can make money by doing a valuable question/comment or by
> providing quality answers.
>
> How do you win money? You must have a Flattr.com account (optional)
> and create a "thing" with your site profile:http://askvalue.com/user/username
>
> If the user gives you credit I believe that you will be flattred (make
> money)
> If you register you can follow your friends, and receive their updates
> (dashboard under construction).. or you can only follow questions of
> your interest.
> You can also vote on your favorite answers!
>
> I'm also planning to implement during the next week email-
> notifications.
>
> I think that this kind of service can encourages users to help more!
> I also believe that Google Groups is very limited and old-fashionable
> for support, and with this you can have a much richer experience.
>
> Please help me by providing me your honest feedback.
> and please don't mock on my design skills.. I need more time for it :)


Re: [web2py] Re: new support platform for web2py - make money

2011-02-12 Thread Ovidio Marinho
sorry for a moment thought I was on the Brazilian list. But I can provide
you the code?

2011/2/12 Francisco Costa 

> Hi Ovideo.. English please :)
> The coding is not finished yet
>
> On Feb 12, 11:53 am, Ovidio Marinho  wrote:
> > Francisco voce pode disponibilizar o codigo para podermos ver as
> novidades
> > que vc colocou nesta app, tipo campos arredondados , icones e etc...
> >
> > 2011/2/11 Francisco Costa 
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > Hello!
> > > During the past months I'm using a lot web2py.
> > > I've been asking a few questions here in this group and I've received
> > > help from people all around the world. Sometimes I really felt like I
> > > should give back something to those kind souls..
> >
> > > So that's why in the past 2 days I've createdhttp://askvalue.com/
> > > (using web2py).
> > > This is alpha version, and I would like your feedback.
> >
> > > AskValue aims to be a social platform of questions and answers where
> > > you can make money by doing a valuable question/comment or by
> > > providing quality answers.
> >
> > > How do you win money? You must have a Flattr.com account (optional)
> > > and create a "thing" with your site profile:
> > >http://askvalue.com/user/username
> >
> > > If the user gives you credit I believe that you will be flattred (make
> > > money)
> > > If you register you can follow your friends, and receive their updates
> > > (dashboard under construction).. or you can only follow questions of
> > > your interest.
> > > You can also vote on your favorite answers!
> >
> > > I'm also planning to implement during the next week email-
> > > notifications.
> >
> > > I think that this kind of service can encourages users to help more!
> > > I also believe that Google Groups is very limited and old-fashionable
> > > for support, and with this you can have a much richer experience.
> >
> > > Please help me by providing me your honest feedback.
> > > and please don't mock on my design skills.. I need more time for it :)
> >
> > --
> > Ovidio Marinho Falcao Neto
> >  ovidio...@gmail.com
> >  Tecnologia da Informaçao
> >  Casa Civil do Governador
> >  83 3214 7885 - 88269088
> >   Paraiba
>



-- 
Ovidio Marinho Falcao Neto
 ovidio...@gmail.com
 Tecnologia da Informaçao
 Casa Civil do Governador
 83 3214 7885 - 88269088
  Paraiba


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread rif
Shoud these steps work?

- download google app engine
- download web2py
- run ./dev_appserver.py ../web2py/
- go to http://localhost:8080

Should it display the welcome app?
I am on a fedora system with python 2.7 and it doesn't (it gives me an long 
stacktrace). Is it because of python version?


[web2py] GAE database namespace

2011-02-12 Thread Jonathan Lundell
I'm trying now to get the trunk running locally in the GAE local server, and 
again getting tickets, and have a question about the GAE db namespace handling.

In welcome's db.py, we have

db = DAL('gae://mynamespace')

...while example uses:

db = DAL('gae')

and admin's access.py uses:

session_db = DAL('gae')



In this configuration, trying to access the ticket generates another ticket. If 
I remove the namespace spec from welcome, then the first ticket is visible. 

(FWIW, I appear to be having trouble importing some OS X Python shared 
libraries; not sure why it seems to work for stable but not trunk. Did we mess 
something up in sys.path?)

Anyway, do we really want to leave that 'mynamespace' reference in welcome?



[web2py] Re: GAE database namespace

2011-02-12 Thread Massimo Di Pierro
Good point. This is a bug. The tickets must be in the same
namespace... Can you please open an issue on google code?

On Feb 12, 3:38 pm, Jonathan Lundell  wrote:
> I'm trying now to get the trunk running locally in the GAE local server, and 
> again getting tickets, and have a question about the GAE db namespace 
> handling.
>
> In welcome's db.py, we have
>
>     db = DAL('gae://mynamespace')
>
> ...while example uses:
>
>     db = DAL('gae')
>
> and admin's access.py uses:
>
>     session_db = DAL('gae')
>
> In this configuration, trying to access the ticket generates another ticket. 
> If I remove the namespace spec from welcome, then the first ticket is visible.
>
> (FWIW, I appear to be having trouble importing some OS X Python shared 
> libraries; not sure why it seems to work for stable but not trunk. Did we 
> mess something up in sys.path?)
>
> Anyway, do we really want to leave that 'mynamespace' reference in welcome?


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
On Sat, Feb 12, 2011 at 01:33:00PM -0800, rif spake:
> Shoud these steps work?
> 
> - download google app engine
> - download web2py
> - run ./dev_appserver.py ../web2py/
> - go to http://localhost:8080
> 
> Should it display the welcome app?
> I am on a fedora system with python 2.7 and it doesn't (it gives me an long 
> stacktrace). Is it because of python version?

Depends on the version of GAE you're running. Support for python 2.7 was added 
very recently and may still be beta (not sure on this).

I've never used GAE SDK on Linux so I'm not sure how it works there. On OS X 
you start the GAE Launcher and add your application to the launcher via a gui 
then start it by clicking on a run button. 


[web2py] integer out of range

2011-02-12 Thread LightOfMooN
DataError: integer out of range

How to make field bigint?


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread feric...@gmail.com
I'm running the latest version of gae 1.4.2 and latest version of web2py. It
didn't work for me on mac so I am trying it on linux now. It works if I
deploy it.

Does it work out of the box for you?


On Sat, Feb 12, 2011 at 11:41 PM, G. Clifford Williams <
g...@notadiscussion.com> wrote:

> On Sat, Feb 12, 2011 at 01:33:00PM -0800, rif spake:
> > Shoud these steps work?
> >
> > - download google app engine
> > - download web2py
> > - run ./dev_appserver.py ../web2py/
> > - go to http://localhost:8080
> >
> > Should it display the welcome app?
> > I am on a fedora system with python 2.7 and it doesn't (it gives me an
> long
> > stacktrace). Is it because of python version?
>
> Depends on the version of GAE you're running. Support for python 2.7 was
> added very recently and may still be beta (not sure on this).
>
> I've never used GAE SDK on Linux so I'm not sure how it works there. On OS
> X you start the GAE Launcher and add your application to the launcher via a
> gui then start it by clicking on a run button.
>


[web2py] Re: integer out of range

2011-02-12 Thread Massimo Di Pierro
You can use SQLCustomField or (better) type='decimal'

On Feb 12, 3:49 pm, LightOfMooN  wrote:
> DataError: integer out of range
>
> How to make field bigint?


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 1:45 PM, feric...@gmail.com wrote:
> I'm running the latest version of gae 1.4.2 and latest version of web2py. It 
> didn't work for me on mac so I am trying it on linux now. It works if I 
> deploy it.
> 
> Does it work out of the box for you?

I've been fighting similar problems on OS X. The short answer seems to be: 
point the SDK at Python 2.5. The symptoms are sort of erratic, but a long stack 
trace that ends in a failure to import some shared C library is what I've been 
seeing: _io or _ctypes so far.

A small point: in the GAE SDK GUI (GoogleAppEngineLauncher) you can set the 
Python version as a Preference (point it to the python binary). But in the 
Preference field, you have to hit Enter, or it doesn't stick.

I'm running Launcher version 1.4.2.1041

I happen to have Python 2.5.4 lying around, and that seems to work, so far. 
2.5.2 is here if you want it: http://www.python.org/download/releases/2.5.2/

> 
> 
> On Sat, Feb 12, 2011 at 11:41 PM, G. Clifford Williams 
>  wrote:
> On Sat, Feb 12, 2011 at 01:33:00PM -0800, rif spake:
> > Shoud these steps work?
> >
> > - download google app engine
> > - download web2py
> > - run ./dev_appserver.py ../web2py/
> > - go to http://localhost:8080
> >
> > Should it display the welcome app?
> > I am on a fedora system with python 2.7 and it doesn't (it gives me an long
> > stacktrace). Is it because of python version?
> 
> Depends on the version of GAE you're running. Support for python 2.7 was 
> added very recently and may still be beta (not sure on this).
> 
> I've never used GAE SDK on Linux so I'm not sure how it works there. On OS X 
> you start the GAE Launcher and add your application to the launcher via a gui 
> then start it by clicking on a run button.
> 




Re: [web2py] Re: GAE database namespace

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 1:41 PM, Massimo Di Pierro wrote:
> 
> Good point. This is a bug. The tickets must be in the same
> namespace... Can you please open an issue on google code?

Done.

I'm listed as the owner, but unless the fix is simply to strip out the 
namespace (which worked for me), I'm not in a position to fix it. 

A mention of the GAE namespace in the book would be helpful, including why one 
might specify one.

> 
> On Feb 12, 3:38 pm, Jonathan Lundell  wrote:
>> I'm trying now to get the trunk running locally in the GAE local server, and 
>> again getting tickets, and have a question about the GAE db namespace 
>> handling.
>> 
>> In welcome's db.py, we have
>> 
>> db = DAL('gae://mynamespace')
>> 
>> ...while example uses:
>> 
>> db = DAL('gae')
>> 
>> and admin's access.py uses:
>> 
>> session_db = DAL('gae')
>> 
>> In this configuration, trying to access the ticket generates another ticket. 
>> If I remove the namespace spec from welcome, then the first ticket is 
>> visible.
>> 
>> (FWIW, I appear to be having trouble importing some OS X Python shared 
>> libraries; not sure why it seems to work for stable but not trunk. Did we 
>> mess something up in sys.path?)
>> 
>> Anyway, do we really want to leave that 'mynamespace' reference in welcome?




[web2py] Re: When is db.commit() unnecessary?

2011-02-12 Thread Dane
Thanks, that is helpful.

On Feb 12, 6:05 pm, Massimo Di Pierro 
wrote:
> every http request works like this:
>
> try:
>    run all models
>    run controller function
>    run view
>    commit all open trasactions
> except:
>    rollback all open transactions
>
> So in models, controllers and views only you need to db.commit() if
> you want to commit despite possible uncaught exceptions later in the
> same actions.
>
> If you use DAL in a script you always need to do db.commit()
>
> On Feb 12, 4:19 pm, Dane  wrote:
>
>
>
>
>
>
>
> > Hello, wondering if someone could clarify when it's unnecessary to
> > call db.commit()? I've noticed it is needed when doing inserts from
> > the console, but it seems to be implicit in controller functions? Just
> > looking for some quick clarification on this. Thanks!


[web2py] GAE local running oddity

2011-02-12 Thread Jonathan Lundell
(Current GoogleAppEngineLauncher on OS X)

This is odd. I've been working on a patch for a little cleanup on web2py's 
handling of sys.path.

When gluon.main is imported, it prefixes some paths to sys.path. These changes 
show up as expected in normal operation, and on GAE. But if we run inside 
GAELauncher, they disappear during requests. That is, if I display sys.path in, 
say, welcome/default/path, I don't see any of the additions that we make in 
main.

Changes that are made in wsgiref (that is, at the time of the request), *do* 
appear.

I'm inclined to see this as a Google bug. Not sure if we need a workaround, but 
it does mean that imports that assume that gluon or site-packages are in 
sys.path won't work when running under GAE Launcher, or the cli equivalent.



[web2py] Re: form.accepts() with reference to other table

2011-02-12 Thread villas
Try commenting out the line 'custom_auth_table.accountID.requires...'
If that doesn't give you any progress, post all your auth model. I'm
sure someone should be able to spot something  obvious -- these bugs
can be right under our noses sometimes :)
-D

On Feb 12, 11:03 pm, Oskari  wrote:
> Thank you for your answer villas!
>
> I don't think that is the problem. I am able to make inserts through
> the appadmin-site, but somehow it fails with form.accepts().
> I also tried what you suggested, but could not quite get it working.
>
> On Feb 12, 8:45 pm, villas  wrote:
>
> > Not sure, but the 3rd attrib of 'IS_IN_DB' doesn't look right?
>
> > Maybe if you tried something like this, e.g.
> > custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,'%
> > (name)s')
>
> > On Feb 12, 1:28 pm, Oskari  wrote:
>
> > > Hi!
>
> > > I'm having trouble making an insert with form.accepts()
>
> > > Currently I have a custom auth_user that has one extra field:
> > > Field('accountID', db.accounts) with
> > > custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,id)
>
> > > While trying to modify variables it fails with "not found in db"
>
> > > def func():
> > >     form=SQLFORM(db.auth_user)
> > >     request.vars.accountID = 1
> > >     if form.accepts(request.vars,session):
> > >         response.flash = "Succesfully created user"
> > >     return dict(form=form)
>
> > > Why does not form.accepts() recognize and accept my accountID?
>
>


[web2py] Re: testing ldap communication?

2011-02-12 Thread tomt
When I tried to get ldap_auth working I used wireshark to look at the
protocol exchange.
I was able to see that I had the ou set incorrectly and when corrected
the authentication worked perfectly.

... some changes I made to db.py .
from gluon.contrib.login_methods.ldap_auth import ldap_auth
...
auth.define_tables(username=True)
...
auth.settings.login_methods.append(ldap_auth(mode='ad',
server='machine.domaincontroller.com',
base_dn='ou=users,dc=domaincontroller,dc=com'))
..


On Feb 11, 7:30 pm, Panupat  wrote:
> I'm really stuck here, would greatly appreciate any help.
>
> Is there a way to check or test if the DAL is communicating with the
> ldap "ad" host? It seems like no matter what settings I used to the
> server and base_dn, even ones that are obviously wrong, I am only
> getting the same "invalid login" error.
>
> I read in some older discussion that I should use
>
> auth.settings.login_methods = [ldap_auth(mode='ad', .
>
> instead of
>
> auth.settings.login_methods.append(ldap_auth(mode='ad', .
>
> Does this still apply to the current version? I'm trying them both
> without luck so far.


[web2py] Re: new support platform for web2py - make money

2011-02-12 Thread Plumo
I got this error when trying to login with facebook:
An error occurred with tymr. Please try again later.

Twitter login works.

But then when I click on most links I get an error:
The page you are looking doesn't exist.

The error image with code showing through is neat!


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread howesc
on ubuntu (and also on osx) i run from the command line.  my command looks 
like this:

python2.5 /home/cfhowes/tools/gae/google_appengine/dev_appserver.py 
--datastore_path 
/home/cfhowes/clients/test/db/dev_appserver_sqlite.datastore 
--blobstore_path /home/cfhowes/clients/test/db/test.blobstore --use_sqlite 
/home/cfhowes/clients/test/source/web2py

i have only had good success with python2.5.

good luck,

cfh


[web2py] apache, wsgi, redirect http to https

2011-02-12 Thread Ed Greenberg
I'd like to redirect http to https so that users who don't specify
https are forced to use it, especially for login/password
transactions. Also it would be nice if the admin pages, which are
blocked in http, would redirect, rather than fail.

There were some postings about htaccess in the group, but none seem to
have ever solved the problem.

I do have control over the server, so I could put mod_rewrite commands
in the virtual host section of the config.  Can anybody give me
pointers on exactly what to protect? Should I do something like this:


RewriteEngine On
RewriteCond %{SERVER_PORT} =80
RewriteRule (.*) https://hostname.example.com/$1 [L,R]


Or is something more complex required.


Re: [web2py] Re: Application logging

2011-02-12 Thread pbreit
What is current recommendation for app logging?

Re: [web2py] apache, wsgi, redirect http to https

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 8:44 PM, Ed Greenberg wrote:
> 
> I'd like to redirect http to https so that users who don't specify
> https are forced to use it, especially for login/password
> transactions. Also it would be nice if the admin pages, which are
> blocked in http, would redirect, rather than fail.
> 
> There were some postings about htaccess in the group, but none seem to
> have ever solved the problem.
> 
> I do have control over the server, so I could put mod_rewrite commands
> in the virtual host section of the config.  Can anybody give me
> pointers on exactly what to protect? Should I do something like this:
> 
> 
> RewriteEngine On
> RewriteCond %{SERVER_PORT} =80
> RewriteRule (.*) https://hostname.example.com/$1 [L,R]
> 
> 
> Or is something more complex required.

Something more complex is required. But not much more complex.

You need to send a redirect to the browser, because the browser has to 
establish an end-to-end secure connection.

Re: [web2py] Re: Application logging

2011-02-12 Thread Jonathan Lundell
On Feb 12, 2011, at 9:44 PM, pbreit wrote:
> What is current recommendation for app logging?

You can start by copying logging.example.conf to logging.conf, and then editing 
it to suit your requirements.

Either log with web2py.app (logger_app) or create a new logger specific to your 
own application.