[web2py] Auth is now always a cas service

2011-05-22 Thread Massimo Di Pierro
With the code in trunk every web2py app is - by default - a CAS service. To connect to from another app: from gluon.contrib.login_methods.cas_auth import CasAuth auth.define_tables(username=True) auth.settings.login_form=CasAuth( globals(), urlbase = "https://127.0.0.1:80

Re: [web2py] Re: confusion - how can we avoid it?

2011-05-22 Thread Jason (spot) Brower
hehe, they will make many happy, but some very angry. :O On Sun, May 22, 2011 at 9:21 PM, Iceberg wrote: > > On May 22, 10:20 pm, Massimo Di Pierro > wrote: > > Looks like the presence of a web2py/setup.py is confusing some users: > > > > http://twitter.com/#!/gvwilson/status/72280501821517824

Re: [web2py] Re: form in loop view

2011-05-22 Thread Stifan Kristi
a, i c, thank you so much for your suggestion pbreit. On Mon, May 23, 2011 at 9:52 AM, pbreit wrote: > I'd suggesting adding an element: > > http://web2py.com/book/default/chapter/07#Adding-extra-form-elements-to-SQLFORM > > Or customizing the form: > http://web2py.com/book/default/chapter/07#Cu

[web2py] Re: 'NoneType' object is unsubscriptable with list:reference

2011-05-22 Thread Massimo Di Pierro
I need your help to debug this. Please edit applications/yourapp/controllers/appadmin.py and replace try: import_csv(db[request.vars.table], request.vars.csvfile.file) response.flash = T('data uploaded') except Exception, e:

Re: [web2py] Re: form in loop view

2011-05-22 Thread pbreit
I'd suggesting adding an element: http://web2py.com/book/default/chapter/07#Adding-extra-form-elements-to-SQLFORM Or customizing the form: http://web2py.com/book/default/chapter/07#Custom-forms

[web2py] Re: Youtube API help

2011-05-22 Thread pbreit
Here are the standard feeds: http://code.google.com/apis/youtube/2.0/reference.html#Standard_feeds Is that what you need?

[web2py] Re: adding columns to SQLTABLE and costumizing headers order

2011-05-22 Thread pbreit
For the counting, did you see this: http://web2py.com/book/default/chapter/06#Grouping-and-Counting

[web2py] Re: adding columns to SQLTABLE and costumizing headers order

2011-05-22 Thread Massimo Di Pierro
Here is how I do it for tags @auth.requires_membership('editor') def edit(): d = db.sometable t = db.tag # has fields name, record_id record = d(request.args(0)) or redirect(URL('index')) def update_tags(form): db(t.record_id==record.id).delete() for tag in request.

[web2py] adding columns to SQLTABLE and costumizing headers order

2011-05-22 Thread blackthorne
I have two tables connected. One is owners, the other is dogs. Let's say I'm listing owners with a nice SQLTABLE(db.owners). Now I wanted to add a column in the generated table with the number of owned dogs db(db.dogs.owner == owner).count() so the end result would be SQLTABLE with an extra column

[web2py] Youtube API help

2011-05-22 Thread JagChris
Good evening, I am having a problem trying to figure out this project of mine. I am suppose to use the youtube api and show the feeds for most popular and most discussed, But i can't seem to figure exactly how to obtain the feed from the youtube api?

Re: [web2py] Re: when to use CRUD versus SQLFORM

2011-05-22 Thread Stifan Kristi
a, i c, i've already re read the book that it seems that the SQLFORM parameter is same like on the parameter in DAL model, can it be collide? which one is use DAL model or SQLFORM? e.g. i set in DAL model : writable = False and in SQLFORM : readonly = False Thank you On Mon, May 23, 2011 at 8:19

[web2py] Re: when to use CRUD versus SQLFORM

2011-05-22 Thread Massimo Di Pierro
a *lot of* overlap. On May 22, 8:08 pm, Stifan Kristi wrote: > log overlap? is it for CRUD? i've already checked in web2py.com/book that > the log is related with crud.message? please correct me if i'm wrong. > thank you > > On Mon, May 23, 2011 at 7:53 AM, Massimo Di Pierro < > > > > > > > > mas

Re: [web2py] Re: when to use CRUD versus SQLFORM

2011-05-22 Thread Stifan Kristi
log overlap? is it for CRUD? i've already checked in web2py.com/book that the log is related with crud.message? please correct me if i'm wrong. thank you On Mon, May 23, 2011 at 7:53 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Use crud for fast prototyping. Use SQLFORM when you n

[web2py] Re: Login form error "KeyError: 'email'" after customizing db.auth_user table

2011-05-22 Thread Anthony
On Sunday, May 22, 2011 4:01:51 PM UTC-4, haggis wrote: > > > Next step is to figure out how to disable the reset password actions. See http://web2py.com/book/default/chapter/08#Restrictions-on-registration. I think it would be: auth.settings.actions_disabled.extend([ 'reset_password','reque

Re: [web2py] Re: form in loop view

2011-05-22 Thread Stifan Kristi
thank you so much for your hint, massimo, i want to follow your advice to put the logic in controller but, i can't , because i'm using the variable that produced by for loop in view side, that i can't do it in controller side. do you have any solutions to put the logic in controller side that have

Re: [web2py] Re: form in loop view

2011-05-22 Thread Stifan Kristi
hi pbreitenbach, my controller not create any form, i just create it on the view side, because i'm using the variable that produced by for loop in view side, that i can't do it in controller side. at the book there is no examples for creating the form in view, just the other one that i use (i mean

[web2py] Re: form in loop view

2011-05-22 Thread Massimo Di Pierro
Technically nothing prevents from doing this: {{ form=SQLFORM() if form.accepts(request): redirect(...) }}{{=form}} but don't. ;-) Put the logic in the controller. On May 22, 7:12 pm, pbreit wrote: > I'm still not sure how this woud work since the controller needs to create > the form in

[web2py] Re: when to use CRUD versus SQLFORM

2011-05-22 Thread Massimo Di Pierro
Use crud for fast prototyping. Use SQLFORM when you need more control. The good thing is that they have a log overlap and you can always change one for the other. On May 22, 7:50 pm, Stifan Kristi wrote: > same for me, still confuse about exact comparation between SQLFORM and CRUD, > plus and min

Re: [web2py] when to use CRUD versus SQLFORM

2011-05-22 Thread Stifan Kristi
same for me, still confuse about exact comparation between SQLFORM and CRUD, plus and minus side overview, but i usually use CRUD, because it's simple (just my opinion). On Mon, May 23, 2011 at 7:39 AM, Ismael Alejandro wrote: > Hi apple! I'm my own experience (may me I'm wrong) I use SQLFORM whe

Re: [web2py] when to use CRUD versus SQLFORM

2011-05-22 Thread Ismael Alejandro
Hi apple! I'm my own experience (may me I'm wrong) I use SQLFORM when I need to customize a little the form, or when I have to deal with an specific var. But, is a good question, same doubt here :s On Sat, May 21, 2011 at 1:35 PM, apple wrote: > Can you do everything using CRUD that you can do

Re: [web2py] Re: form in loop view

2011-05-22 Thread pbreit
I'm still not sure how this woud work since the controller needs to create the form in order to do the form.accepts() processing. What does your controller look like. Are there any examples in the book of creating the form in a view? If not, I'm guessing it's not possible.

Re: [web2py] Re: form in loop view

2011-05-22 Thread Stifan Kristi
hi pbreit, html source was fine, the strange things, that the form can be submit after i put {{pass}} or {{continue}} after i declared the form, but i don't want to put {{pass}} or {{continue}} because the whole code after i put {{pass}} or {{continue}} is not working, any ideas, hints or pointers

[web2py] Re: 'NoneType' object is unsubscriptable with list:reference

2011-05-22 Thread Massimo Di Pierro
Can you try the code in trunk. We just changed a few things in there related to csv import. On May 22, 2:08 pm, Gustavo Maggi wrote: > Hi, I'm trying to do the following: > > 1) In the model: > > db.define_table('dad',Field('name')) > > db.define_table('son',Field('name'),Field('dads','list:refer

[web2py] Re: 'Auth' object has no attribute 'signature'

2011-05-22 Thread Massimo Di Pierro
you must have an old web2py version. On May 22, 12:08 pm, Tito Garrido wrote: > I've installed plugin wiki and got this running my app, any clue? > > web2py™ Version 1.91.6 (2011-01-03 17:55:14)  Python Python 2.5.4: > /usr/local/bin/python > > Traceback (most recent call last): >   File "/home/t

[web2py] JSONP in web2py...

2011-05-22 Thread Marcelo Alaniz
Hi, maybe this help to somebody. i'm developing a webapp with restful interface. But i need cross-site json, then begin with jsonp. But web2py don't support generic.jsonp for urls like http://server:port/app/file/controller.jsonp i did this creating a new file generic.jsonp in views with this con

[web2py] Re: 'NoneType' object is unsubscriptable with list:reference

2011-05-22 Thread howesc
can you post the full traceback of your error? I have seen some cases where similar errors appear on GAE with list:reference fields, but i don't want to send you on a wild goose chase. the thing i am thinking of is that on GAE when you have a list:reference the table that you reference must ha

[web2py] exporting to csv

2011-05-22 Thread Andrew Thompson
Greetings, I went through several old posts and pages looking for a way to export to csv. I cobbled this together and thought it might be useful to the community. To use it, place the attached file as /views/generic.csv and do the following: response.view='generic.csv' return dict(filename

[web2py] Re: Login form error "KeyError: 'email'" after customizing db.auth_user table

2011-05-22 Thread haggis
Thanks both of you! This helped me understanding a little bit more of what happens inside. As Anthony suggested I just renamed the 'name' field to 'username' and everything is fine now. Next step is to figure out how to disable the reset password actions.

[web2py] 'NoneType' object is unsubscriptable with list:reference

2011-05-22 Thread Gustavo Maggi
Hi, I'm trying to do the following: 1) In the model: db.define_table('dad',Field('name')) db.define_table('son',Field('name'),Field('dads','list:reference dad')) 2) Create some registers in the appadmin interface: dad.id

[web2py] [BUG] Plugin wiki attachaments not working

2011-05-22 Thread Tito Garrido
web2py™ Version 1.96.0 (2011-05-22 09:34:40) Python Python 2.6.1: /usr/bin/python Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Traceback (most recent call last): File "/Users/titogarrido/Documents/Projetos/web2py/gluon/restricted.py", line 184, in restricted exec ccode in environment File

[web2py] Re: confusion - how can we avoid it?

2011-05-22 Thread Iceberg
On May 22, 10:20 pm, Massimo Di Pierro wrote: > Looks like the presence of a web2py/setup.py is confusing some users: > > http://twitter.com/#!/gvwilson/status/72280501821517824 > > What can we do to make obvious that people should use > > python web2py.py > > and not > > python setup.py install

Re: [web2py] confusion - how can we avoid it?

2011-05-22 Thread Jonathan Lundell
Move it to scripts? Mutatis mutandis. On May 22, 2011, at 9:20 AM, Massimo Di Pierro wrote: > Looks like the presence of a web2py/setup.py is confusing some users: > > http://twitter.com/#!/gvwilson/status/72280501821517824 > > What can we do to make obvious that people should use > > pytho

[web2py] 'Auth' object has no attribute 'signature'

2011-05-22 Thread Tito Garrido
I've installed plugin wiki and got this running my app, any clue? web2py™ Version 1.91.6 (2011-01-03 17:55:14) Python Python 2.5.4: /usr/local/bin/python Traceback (most recent call last): File "/home/titogarrido/webapps/web2py/web2py/gluon/restricted.py", line 188, in restricted exec c

[web2py] Re: form in loop view

2011-05-22 Thread pbreit
Can you look at the HTML source to see if the form looks correct? I was not aware that you could create the form in the view.

[web2py] Re: Consuming a web2py web service in C#?

2011-05-22 Thread nick name
I am doing something similar, but using the .NET built in JSON DataContract serializer. The things I've hit so far: a) Anything other than a 200 return will raise an exception (understandable), but not give you access to the returned json (bad; e.g. 403 responses often have useful data with the

[web2py] Re: signed URL - please help test it!

2011-05-22 Thread Massimo Di Pierro
long poll is not a good idea without aync and wsgi is not designed for async. On May 21, 10:41 pm, BearXu wrote: > This is like the channel API in the app engine. > Hope that rocket can support long pool in the future. > > On 22 May 2011 08:47, Massimo Di Pierro wrote: > > > > > > > > > There is

Re: [web2py] signed URL - please help test it!

2011-05-22 Thread Jason Brower
That's a nice feature and very easy to use! I do some crazy applications at my work that could use this. BR, Jason Brower On 05/22/2011 06:41 AM, BearXu wrote: This is like the channel API in the app engine. Hope that rocket can support long pool in the future. On 22 May 2011 08:47, Massimo Di

Re: [web2py] form in loop view

2011-05-22 Thread Stifan Kristi
thank you so much for your replied marin, my intention is to show up blog comment form in the blog index, so that while the user see blog, they can comment it in 1 page. actually i have 2 form in blog index, 1 is for pass the hidden id when user click like. i just learn it from : http://web2py.com/

Re: [web2py] form in loop view

2011-05-22 Thread Marin Pranjic
Not sure if i understood, but if you have multiple forms, you can use SQLFORM with form.accepts(formname = 'form_'+str(i), ...) each form has it's own formname, so form.accepts will know which one is submitted. Is that your problem? On Sun, May 22, 2011 at 10:02 AM, 黄祥 wrote: > hi, > > is it pos

[web2py] form in loop view

2011-05-22 Thread 黄祥
hi, is it possible to use form in loop view? e.g. {{for i, row in enumerate(rows):}} {{if i == items_per_page: break}} {{db.blog_comment.blog_id.default = row.id}} {{form = crud.create(db.blog_comment, message = T('Record Inserted'))}} {{=DIV(form)}} {{p