[web2py:10040] Re: Customizing forms

2008-10-10 Thread billf
I have gone down the route of using the following controller code (I've left out a few checks for simplicity) recipes=db(db.recipe.id==id).select() recipe=recipes[0] form=SQLFORM(db.recipe, recipe) return dict(form=form) ... and in the view Name: etc. This seems to work well BUT I want to u

[web2py:10041] Re: web2py book finally online in PDF

2008-10-10 Thread Daniel Contag
That would be great! Daniel On Fri, Oct 10, 2008 at 08:59, mdipierro <[EMAIL PROTECTED]> wrote: > > I have emailed the publisher again about this. We agreed on PDF. I was > not aware of this system that they are using and I do not like it. > People should be able to print it. If he does not fixe

[web2py:10042] Re: web2py book finally online in PDF

2008-10-10 Thread Timothy Farrell
I'm glad to hear that. I'm looking forward to a true-PDF option. -tim mdipierro wrote: > I have emailed the publisher again about this. We agreed on PDF. I was > not aware of this system that they are using and I do not like it. > People should be able to print it. If he does not fixes it I will

[web2py:10044] Re: web2py book finally online in PDF

2008-10-10 Thread Jaroslaw Zabiello
Massimo, what do you think about about http://safari.oreilly.com/? It is very good service. All books can be crosslinked, searched, printed, you can sell even Draft version. On Oct 10, 7:59 am, mdipierro <[EMAIL PROTECTED]> wrote: > I have emailed the publisher again about this. We agreed on PDF

[web2py:10046] Re: Customizing forms

2008-10-10 Thread mdipierro
OK just replace recipe=recipes[0] with recipe=recipes[0] if recipes else None On Oct 10, 5:57 am, billf <[EMAIL PROTECTED]> wrote: > I have gone down the route of using the following controller code > (I've left out a few checks for simplicity) > > recipes=db(db.recipe.id==id).select() > recip

[web2py:10043] Re: web2py book finally online in PDF

2008-10-10 Thread Jaroslaw Zabiello
Do not do it. Mobipocket does not work on Mac OS X nor iPhone, blah. On Oct 10, 7:50 am, seeker <[EMAIL PROTECTED]> wrote: > Any chance that the book can also be sold through Mobi?  They also > provide protection, if that is big a concern, and the format is a lot > more popular. --~--~-

[web2py:10045] Re: Customizing forms

2008-10-10 Thread DenesL
What I would like to see is a form where the components are accesible by field name. I think you once said something about extending the SQLFORM class, any rules on this?. I am also siding with Jose on the use of DIVs instead of TRs since they are more easily manipulated using CSS (e.g. http://j

[web2py:10049] Re: Customizing forms

2008-10-10 Thread mdipierro
I do not understand what you mean. could you provide an examle? On Oct 10, 9:35 am, "José Deodoro de Oliveira Filho" <[EMAIL PROTECTED]> wrote: > Just out of curiosity: I've gone that way and what I noticed is that I > loose the error divs, then I went back to using {{=form}}. Is that > correct ?

[web2py:10050] Re: web2py book finally online in PDF

2008-10-10 Thread mdipierro
Just send to the editor " My users need a true PDF option. How difficult would it be to use http://safari.oreilly.com? I understand they work with Wiley. I am also considering giving the original PDF away for free. " Massimo On Oct 10, 6:35 am, Baron <[EMAIL PROTECTED]> wrote: > I went to downl

[web2py:10051] Re: web2py book finally online in PDF

2008-10-10 Thread Phyo Arkar
No linux = No Buying for me.. I want PDF .. On Fri, Oct 10, 2008 at 11:35 AM, Baron <[EMAIL PROTECTED]> wrote: > > I went to download the software but found there is no Linux version: > http://www.vitalsource.com/software/bookshelf/mbs-downloads/ > > > > On Oct 10, 5:59 pm, mdipierro <[EMAIL PRO

[web2py:10047] Re: web2py book finally online in PDF

2008-10-10 Thread Baron
I went to download the software but found there is no Linux version: http://www.vitalsource.com/software/bookshelf/mbs-downloads/ On Oct 10, 5:59 pm, mdipierro <[EMAIL PROTECTED]> wrote: > I have emailed the publisher again about this. We agreed on PDF. I was > not aware of this system that the

[web2py:10052] Re: Customizing forms

2008-10-10 Thread José Deodoro de Oliveira Filho
Sorry, I mean I built a form, like Bill, manually: >> >> > >> action="controller_name"> >> >> >> >> >> Name:> >> size="50" maxlength="50" value="{{=form.record.name}}"/> >> >> etc. And the drawback is that I miss the error divs generated by the validators (which are a big plus), so I'd better

[web2py:10048] Re: Customizing forms

2008-10-10 Thread José Deodoro de Oliveira Filho
Just out of curiosity: I've gone that way and what I noticed is that I loose the error divs, then I went back to using {{=form}}. Is that correct ? Deodoro Filho On Fri, Oct 10, 2008 at 11:28 AM, mdipierro <[EMAIL PROTECTED]> wrote: > > OK just replace > > recipe=recipes[0] > > with > > recipe=r

[web2py:10054] Re: Customizing forms

2008-10-10 Thread mdipierro
Yes. There would be no error dislayed. The errors are in the dict form.errors so you can insert things like {{if form.errors.has_key('name'):}}Ops, error:{{=form.vars.name}} {{pass}} Massimo On Oct 10, 10:20 am, "José Deodoro de Oliveira Filho" <[EMAIL PROTECTED]> wrote: > Sorry, > > I mean I b

[web2py:10055] Re: web2py book finally online in PDF

2008-10-10 Thread mdipierro
I agree. I am sorry and I can assure you when discussing with the editor no other format was ever mentioned other than PDF. On Oct 10, 10:11 am, "Phyo Arkar" <[EMAIL PROTECTED]> wrote: > No linux = No Buying for me.. > > I want PDF .. > > On Fri, Oct 10, 2008 at 11:35 AM, Baron <[EMAIL PROTECTED]

[web2py:10053] Re: Customizing forms

2008-10-10 Thread mdipierro
Yes. There would be no error dislayed. The errors are in the dict form.errors so you can insert things like {{if form.errors.has_key('name'):}}Ops, error:{{=form.vars.name}} {{pass}} Massimo On Oct 10, 10:20 am, "José Deodoro de Oliveira Filho" <[EMAIL PROTECTED]> wrote: > Sorry, > > I mean I b

[web2py:10056] Re: some undebuggable problems..

2008-10-10 Thread Phyo Arkar
Another DB problem I tried to changed database schema , data type Text to string , and now it is giving this error : code : Ticket 127.0.0.1.2008-10-10.23-35-33.c7c54895-a27b-43b1-bf3d-2888acd4527e Error traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call last): File "/opt/w

[web2py:10057] Re: some undebuggable problems..

2008-10-10 Thread Phyo Arkar
Code : dbOBJECT.define_table("student", SQLField("std_id", "string", length=32, notnull=True, default=None), SQLField("std_name", "string", length=80, notnull=True, default=None), SQLField("password", "password", notnull=True, default=None)) On Fri, Oct 10, 2008 at 5:21 PM, P

[web2py:10058] Re: Dispatcher

2008-10-10 Thread Timothy Farrell
# ps ax | grep 'dispatcher' | grep -v 'grep' | sed -e "s/ ?.*//" 123456 # renice -10 123456 (just a friendly reminder) mdipierro wrote: > processing > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2

[web2py:10059] Re: some undebuggable problems..

2008-10-10 Thread mdipierro
You can only drop it after define. If you know for sure the table exists it is ok to do db=SQLDB(..) db.define_table('student',migrate=False) db.student.drop() On Oct 10, 12:22 pm, "Phyo Arkar" <[EMAIL PROTECTED]> wrote: > Code : > > dbOBJECT.define_table("student", > SQLField("std_id", "

[web2py:10061] Re: web2py book finally online in PDF

2008-10-10 Thread Phyo Arkar
Its ok if there is no PDF, Ther is "Web2py Man" Massimo Already :D We can ask anything we want he will help in a flash :D . On Fri, Oct 10, 2008 at 12:45 PM, Timothy Farrell <[EMAIL PROTECTED]>wrote: > I'm glad to hear that. I'm looking forward to a true-PDF option. > > -tim > > > mdipierro

[web2py:10062] Re: some undebuggable problems..

2008-10-10 Thread mdipierro
No. In principle you should never drop. When you drop you lose all your data. On Oct 10, 12:50 pm, "Phyo Arkar" <[EMAIL PROTECTED]> wrote: > Thanks I will try; > > if i alter table , have to always drop? > > On Fri, Oct 10, 2008 at 5:40 PM, mdipierro <[EMAIL PROTECTED]> wrote: > > > You can only

[web2py:10060] Re: some undebuggable problems..

2008-10-10 Thread Phyo Arkar
Thanks I will try; if i alter table , have to always drop? On Fri, Oct 10, 2008 at 5:40 PM, mdipierro <[EMAIL PROTECTED]> wrote: > > You can only drop it after define. > > If you know for sure the table exists it is ok to do > > db=SQLDB(..) > db.define_table('student',migrate=False) > db.studen

[web2py:10063] Re: Dispatcher

2008-10-10 Thread mdipierro
Got the message. I am kind of swamped these days. This will happen but needs a little more design to make it right. It is in the todo list but will now happen tomorrow. On Oct 10, 12:29 pm, Timothy Farrell <[EMAIL PROTECTED]> wrote: > # ps ax | grep 'dispatcher' | grep -v 'grep' | sed -e "s/ ?.*/

[web2py:10064] Re: web2py book finally online in PDF

2008-10-10 Thread Phyo Arkar
Dear Massimo; Wow You going to release Online PDF for FREE FANTASTIC!! Really!!?? or just to scare oreilly up? :D On Fri, Oct 10, 2008 at 3:10 PM, mdipierro <[EMAIL PROTECTED]> wrote: > > Just send to the editor > > " > My users need a true PDF option. How difficult would it be to use > ht

[web2py:10065] Re: Dispatcher

2008-10-10 Thread mdipierro
I think in routes.py there should be routes on error for different types of error. The problem is this may cause circular references. Timothy Farrell wrote: > # ps ax | grep 'dispatcher' | grep -v 'grep' | sed -e "s/ ?.*//" > 123456 > # renice -10 123456 > > (just a friendly reminder) > > mdipier

[web2py:10066] Re: some undebuggable problems..

2008-10-10 Thread Phyo Arkar
yeah , i lost all my data everytime i change a datatype for afield , in the table defination.. So , how to make it work without dropping? On Fri, Oct 10, 2008 at 6:00 PM, mdipierro <[EMAIL PROTECTED]> wrote: > > No. In principle you should never drop. When you drop you lose all > your data. >

[web2py:10067] Re: some undebuggable problems..

2008-10-10 Thread Phyo Arkar
Thats only happens in mysql , its ok with sqllite. On Fri, Oct 10, 2008 at 6:04 PM, Phyo Arkar <[EMAIL PROTECTED]>wrote: > yeah , i lost all my data everytime i change a datatype for afield , in the > table defination.. > > So , how to make it work without dropping? > > > > > On Fri, Oct 10, 2008

[web2py:10068] Re: web2py book finally online in PDF

2008-10-10 Thread Timothy Farrell
Just to be technically correct. He said he might do it for free if the publisher wasn't cooperating. That would be great for us, but he's worked hard on this and deserves to be paid for it. Let's not apply any undo pressure. =) Phyo Arkar wrote: > Dear Massimo; > > Wow You going to release O

[web2py:10069] Re: web2py book finally online in PDF

2008-10-10 Thread Phyo Arkar
Yeah i know :D I am waiting to buy PDF version . If hes going to release it , i gonna offer him my enterprise plan web hosting for free for him :D. On Fri, Oct 10, 2008 at 6:09 PM, Timothy Farrell <[EMAIL PROTECTED]> wrote: > Just to be technically correct. > > He said he might do it for free i

[web2py:10070] Re: Dispatcher

2008-10-10 Thread Timothy Farrell
I know you're busy, I just don't want this to get lost in the fray. I don't mean to be naggy. Anyway... I actually had that idea a while ago but never presented because I thought you would be against it. Anyway, I like this concept better anyway. Here's an idea: - Have a generic error page (s

[web2py:10071] Re: Customizing forms

2008-10-10 Thread billf
The problem I have is that when recipe=None, =form.record.any_field fails hence the thinking that a "new" record containing defaults would overcome this. I have had a stab with the following: class SQLROW(SQLStorage): """ Return a row created from the table definition with values set to

[web2py:10072] Re: questions about sessions, user authentication, etc

2008-10-10 Thread pedro
My doubts are more like: When exactly does a session start and ends? Does closing the browser ends current session? Thank you On 10 Okt, 05:53, "Steve Shepherd" <[EMAIL PROTECTED]> wrote: > I will have a go at this. > > 1. The Google account does not reply on GAE. You could be in our out of GA

[web2py:10073] Re: questions about sessions, user authentication, etc

2008-10-10 Thread Timothy Farrell
A session starts the first time a page is requested from web2py where "session.forget()" is not in the controller. The session key is stored on the user's browser in a session cookie. Cookies can have any preset expiration date (although IE6 is stupid about this and defaults most cookies to be

[web2py:10074] Re: Dispatcher

2008-10-10 Thread mdipierro
Right now there are various types of errors: - URL does not pass validation - Invalid controller - Invalid action - Invalid static file They all raise HTTP(400,"message",web2py_error="") and if - A ticket is being issues It raises HTTP(200) but the page shows the ticket number. The value

[web2py:10075] Re: questions about sessions, user authentication, etc

2008-10-10 Thread pedro
yes. thank you. On 10 Okt, 22:17, Timothy Farrell <[EMAIL PROTECTED]> wrote: > A session starts the first time a page is requested from web2py where > "session.forget()" is not in the controller. > > The session key is stored on the user's browser in a session cookie.   > Cookies can have any pre

[web2py:10076] Re: Customizing forms

2008-10-10 Thread billf
Next installment :-/ (As a reminder, the objective is to create an SQLFORM in the controller that can be used to validate/update using request.vars from a separate custom form. The problem was how to include the required formkey and formkey value in the custom form.) Please note the changes des

[web2py:10077] Re: Customizing forms

2008-10-10 Thread mdipierro
1) About SQLROWS below. I am not sure what it is supposed to do. SQLFORM(table,None) should already pre-populate the form with default values from table.field.default. 2) formname is in form.formname and defined in SQLFORM(formname='bla bla') 3) formkey is in session._formkey but only AFTER the

[web2py:10078] Re: Customizing forms

2008-10-10 Thread mdipierro
correction... formkey goes in session['_formkey[%s]' % form.formname] perhaps this variable should be set when the form is accepted, not when serialized Massimo On Oct 10, 5:31 pm, mdipierro <[EMAIL PROTECTED]> wrote: > 1) About SQLROWS below. I am not sure what it is supposed to do. > SQL

[web2py:10079] Re: generate menu with category headers

2008-10-10 Thread Snoboardfreak
I went back to Massimos original code... and now I get this error: TypeError: 'NoneType' object is not iterable ticket: for head in response.menu: response.write('\n',escape=False) response.write(A(head[0],_href=head[2])) response.write('\n \

[web2py:10080] Re: Dispatcher

2008-10-10 Thread voltron
It would be cool if the routes were configured as a WSGI plugin as in Pylons, but I am content, it was tough to get Massimo to allow routing :-D. In case it does get to be re-coded as a WSGI plugin, why place error handling in it? Would it not be better to have an error handling plugin that "gener

[web2py:10081] Re: Dispatcher

2008-10-10 Thread mdipierro
Yes. It would not be for every URL but it should be able to distingish different causes or error (user error as invalid URL from internal error that causes a ticket). Massimo On Oct 10, 7:55 pm, voltron <[EMAIL PROTECTED]> wrote: > It would be cool if the routes were configured as a WSGI plugin

[web2py:10082] Form Question

2008-10-10 Thread kev
Ok so i have a little problem which i cant seem to solve. In default.py controller i have a SQLFORM to display registration form. Now in the SQLFORM i have _action=URL(r=request, c='user', f='register') which transfer the form over to user/register. (i want to make controller for different things

[web2py:10083] Re: Customizing forms

2008-10-10 Thread billf
Massimo Thanks for your answers. > 1) About SQLROWS below. I am not sure what it is supposed to do. > SQLFORM(table,None) should already pre-populate the form with default > values from table.field.default. I asked the question Oct 10 11.57am "does a function already exist?" but didn't get this

[web2py:10084] Re: ORM to abstractly collect all data in database

2008-10-10 Thread Ed
In my original post, I used HTML tags just to illustrate what I was trying to do. In my actual implementation, I may use non-HTML XML, the web2py template syntax, or maybe something else. Ed On Oct 1, 7:57 pm, JorgeRpo <[EMAIL PROTECTED]> wrote: > why dont you use the template syntax? > > Ed wr

[web2py:10085] Re: ORM to abstractly collect all data in database

2008-10-10 Thread Ed
Thanks Massimo, I tried the code you suggest and received the following error: table.append(TR(*[TH(field) for field in db[table].fields])) KeyError: Any idea why? Ed On Oct 1, 8:13 pm, mdipierro <[EMAIL PROTECTED]> wrote: > You can but your implementation is not the way to do it. If y