[web2py] generic.html controller wide?

2012-08-20 Thread Toby Shepard
I was thinking that it would be nice if I could make a director in the views folder matching a controller name, but then just put a file in there called 'generic.html' that would apply to any function called in that controller. Perhaps there is another way to do this. Thanks, Tobiah --

Re: [web2py] Re: Get result set back as list?

2012-08-11 Thread Toby Shepard
On 8/10/2012 3:58 PM, Vasile Ermicioi wrote: for me that works alist = db(db.auth_user).select().as_list() How funny. I was just making up the name as_list(). Great minds think alike I guess. I was looking for a flat list of field values, but the list comprehension solution is ok I guess.

[web2py] Get result set back as list?

2012-08-10 Thread Toby Shepard
I'm in a situation where I just want a single column back from a table. I'd like it as a list so I could just pass it on to the next function. All I can think of is something like: temp = [] for thing in db(db.mytable).select(db.mytable.myfield): temp.append(th

Re: [web2py] Re: Subclass FORM?

2012-08-03 Thread Toby Shepard
def __init__(self): super(Document, self).__init__(self) Don't pass self to __init__() -- should be: Ahh... much better. Thanks! Tobiah --

Re: [web2py] Re: Question about a section of the book.

2012-08-03 Thread Toby Shepard
On 08/02/2012 12:29 PM, Niphlod wrote: formname='something' serializes within the form a hidden input, so web2py can distinguish what form is being submitted. If the submitted values were to be serialized as urlencoded, just to explain, for the first form would be name=value&formname=form_one a

[web2py] Subclass FORM?

2012-08-02 Thread Toby Shepard
I tried doing this: def index(): doc = Document() return doc class Document(FORM): def __init__(self): super(Document, self).__init__(self) self.append('A message') But when I run it I get this huge ticket with an error about recursion. I wouldn't have thought

Re: [web2py] Re: Question about a section of the book.

2012-08-02 Thread Toby Shepard
etely. Massimo On Thursday, 2 August 2012 13:13:10 UTC-5, Toby Shepard wrote: In the forms section: It is possible to have multiple forms per page, but you must allow web2py to distinguish them. If these are derived by SQLFORM from different tables, then web2py gives them different names automati

[web2py] Question about a section of the book.

2012-08-02 Thread Toby Shepard
In the forms section: It is possible to have multiple forms per page, but you must allow web2py to distinguish them. If these are derived by SQLFORM from different tables, then web2py gives them different names automatically; otherwise you need to explicitly give them different form names. Her

[web2py] BR()

2012-07-25 Thread Toby Shepard
In my own html generating libraries, I normally allow an integer argument to the maker, which is a count of how many tags to put out. So: {{=BR(5)}} could output This works out since the BR tag can't have any components anyway. Just a thought. I find it useful at times. Tobiah --

Re: [web2py] Re: callback on an anchor tag

2012-07-25 Thread Toby Shepard
On 07/25/2012 09:21 AM, Anthony wrote: Ok, thanks. Perhaps there is a small problem with the manual section on views. I copied my example from the manual: {{=A('click me', callback=URL('myaction'), target="t")}} and the response of the ajax callback will be stored in the D

Re: [web2py] Re: callback on an anchor tag

2012-07-25 Thread Toby Shepard
On 07/24/2012 06:48 PM, Massimo Di Pierro wrote: {{=A("CLICK ME!!", callback=URL('http://mysite.com/foo.html' ), target='hater')}} should be {{=A("CLICK ME!!", callback='http://mysite.com/foo.html' ,target='hater')}} Ok, so now I have:

Re: [web2py] Re: callback on an anchor tag

2012-07-25 Thread Toby Shepard
equal to "t". Tobiah which would produce: http://mysite.com/foo.html',[],'hater';);return false">CLICK ME!! and that is what is expected. Perhaps I misunderstand the question. On Tuesday, 24 July 2012 16:21:59 UTC-5, Toby Shepard wrote: Working through

Re: [web2py] Re: Suggestion - a pickled DAL field

2012-07-25 Thread Toby Shepard
On 07/24/2012 06:55 PM, Anthony wrote: On Tuesday, July 24, 2012 5:58:29 PM UTC-4, Derek wrote: Make it a computed field? I'm not sure that would be helpful in this case. A computed field computes its value automatically based on other fields in the record, but in this case, he needs to pi

[web2py] callback on an anchor tag

2012-07-24 Thread Toby Shepard
Working through the html helper docs, I decided to try the callback parameter to the anchor tag: {{=A("CLICK ME!!", callback=URL('http://mysite.com/foo.html'), target='hater')}} {{=DIV(_id = 'hater')}} foo.html delivers a bit of content. This did not work. Viewing the source, I see that the