[web2py] Using rpy2 with web2py does not work

2010-02-20 Thread Dutch opera
On my local linux machine I can run R using rpy2 from python. When I take the same code and I use web2py I get this error ImportError: No module named rpy2.robjects I am trying to import the following into the default.py controller. import rpy2.robjects as ro import rpy2.rlike.container as

[web2py] Re: Using rpy2 with web2py does not work

2010-02-20 Thread Dutch opera
It looks like it I start web2py on my test machine using python web2py.py. Version is 2.6. I dont have 2.5. On Feb 20, 10:52 pm, mdipierro wrote: > Are you sure you have only one python installed? > > On Feb 20, 6:07 am, Dutch opera wrote: > > > On my local linux m

[web2py] Getting R to work with web2py

2010-03-21 Thread Dutch opera
Hi, I can use rpy2 in python. When I run web2py I get this error... n \nRuntimeError: R_HOME not defined, and no R command in the PATH.\n' p8 s. What do I have to add in the controller to be able to use rpy2 and R? For all other apps...R and rpy2 work Thanks -- You received this message

[web2py:28021] db and the shell..trying to print db.tables

2009-08-05 Thread Dutch opera
Hi, In my db.py file I have the following. db = SQLDB('mysql://username:passw...@127.0.0.1:3306/test_db') My DB code works. I am trying to run test in the shell. I run >>> db = SQLDB('mysql://username:passw...@127.0.0.1:3306/ test_db') Then then run >>> print db.tables In[23]: print db.tabl

[web2py:28030] Re: db and the shell..trying to print db.tables

2009-08-05 Thread Dutch Opera
ur > model? Are there? > > On Aug 5, 8:17 am, Dutch opera wrote: >> Hi, >> >> In my db.py file I have the following. >> >> db = SQLDB('mysql://username:passw...@127.0.0.1:3306/test_db') >> >> My DB code works. >> >> I am trying t

[web2py:28034] Re: db and the shell..trying to print db.tables

2009-08-05 Thread Dutch Opera
All I do is to the shell in the GUI controller section. I input db = SQLDB('mysql://username:passw...@127.0.0.1:3306/test_db') into the shell I assume that would allow me to have access to the database so I can test some query. Maybee I am missing a step or two...I am trying to follow instructi

[web2py:28060] Re: db and the shell..trying to print db.tables

2009-08-05 Thread Dutch Opera
Yes...that was the problem Thanks On Wed, Aug 5, 2009 at 5:30 AM, mdipierro wrote: > > If you use the web based shell there is not need for -M (that is > default). > > The issue is probably that (assuming the tables are defined in db.py), > then the object "db" is already defined in the

[web2py:28065] How to do a groupby without error

2009-08-05 Thread Dutch opera
Below is a query that works. It does a sum and groups by date. db().select(db.test.date,db.test.url,db.test.hits.sum(),groupby= (db.test.date)) Here is a query that does not work. I just added an additional groupby. db().select(db.test.date,db.test.url,db.test.hits.sum(),groupby= (db.test.

[web2py:28073] SQL and name of SUM field in a groupby

2009-08-05 Thread Dutch opera
Hi, If I have this query db().select(db.test.date,db. test.url,db.test.hits.sum(), db.test.rev.sum(), groupby= db.test.datel) What is the name of the hits field? In SQL I would do sum(hits) as sum_hits and sum(rev) as sum_rev E.G. for i in results: print i.sum_hits, i.sum_rev I see

[web2py:28081] Shell...print dates from query

2009-08-06 Thread Dutch opera
Hi, my query seens to work. In the shell...I run the query and I print the results 2009-07-27,0,0,0 2009-07-28,0,0,0 2009-07-29,0,0,0 if I loop though each of the fields they work...expect the date field. My mysql its stored as a datetime. in the shell for r in records: print r

[web2py:28086] Re: Shell...print dates from query

2009-08-06 Thread Dutch opera
H..I figured it but it was not clearI get a group by clause and the date was a group was nested in the results On Aug 5, 10:12 pm, Dutch opera wrote: > Hi, > > my  query seens to work.  In the shell...I run the query and I print > the results > > 2009-07-

[web2py:28191] Login, Auth and Fields and Custom

2009-08-07 Thread Dutch opera
Hi, If I add the below I can login. #Controller def login: return dict(form=auth.login()) #View {{=form}} I need to style the submit button and the email and username fields. >From the controller..how to I add email and password as separate fields and to custom submit button while keeping

[web2py:28214] auth.login() and form.custom field access

2009-08-08 Thread Dutch opera
Hi, I am trying to style the auth.login() fields and access them indivialuall so I can place them in separate div tags. in the html I tried form.custom.label.email form.custom.label.password Seemed to work. What about the widget type? using form.custom.input.email gave me this error Attribu

[web2py:28216] Re: auth.login() and form.custom field access

2009-08-08 Thread Dutch opera
PS... I tried the following.. This the correct? If so...all that is left to do is to get the submit widget. How do I do that? Thanks On Aug 8, 4:28 am, Dutch opera wrote: > Hi, > > I am trying to style the auth.login() fields and access them > indivialuall so I can p

[web2py:28218] Re: auth.login() and form.custom field access

2009-08-08 Thread Dutch Opera
:28 pm, Dutch opera wrote: > > I am trying to style the auth.login() fields and access them > > indivialuall so I can place them in separate div tags. > > in the html I tried > > form.custom.label.email > > form.custom.label.password > > Seemed to

[web2py:28219] Re: auth.login() and form.custom field access

2009-08-08 Thread Dutch opera
Thanks I just added I justed added {{=form.hidden_fields()}} and it worked...and it worked..yeah... On Aug 8, 4:36 am, Dutch opera wrote: > PS... > > I tried the following.. > > > > > This the correct? > > If so...all that is left to do is to get the subm

[web2py:28297] cancel using {{=form.custom}} but cant get it to work

2009-08-10 Thread Dutch opera
Hi, I=have the form form=auth.retrieve_password() form[0][-1][1].append(INPUT (_type='button',_value='Cancel',_onclick="window.location='%s';"%URL (r=request,f='login'))) In my view,,, I want to do this {{=form.custom.begin}} {{=form.custom.widget.email}} {{=form.custom.submit}} {{=form.custo

[web2py:31082] Getting changing password to work in Fire Fox

2009-09-15 Thread Dutch opera
Hi, I added a change password page to web2py. In the controller I have the following def change_password(): form=auth.change_password() form[0][-1][1].append(INPUT (_type='button',_value='Cancel',_onclick="window.location='%s';"%URL (r=request,f='index'))) return dict(form=form)

[web2py:31304] Filtering users by role

2009-09-19 Thread Dutch opera
Hi, I have a standard role and user setup. Lets have a have 1000 user id's. And I have three roles 1) client 2) admin1 and 3) admin 2. Admin 1 can have access to 1-500 if the id's and role two can have access for id's of 501-1000. What is the best way to this? Do I need to create a lookup tab

[web2py] How to retrieve password

2010-01-23 Thread Dutch opera
Hi, I want to use ajax to retrieve a password. Soif I use ajax to send the user email name to the ajax function. 1) How to I set set the code I need to return the password? I am not looking for other ways to accomplish this task. Here is my code def ajax_retrieve_password(): ema