[web2py] Re: Working with custom form

2012-07-13 Thread Massimo Di Pierro
I applied your line to auth_user: db.auth_user.password.requires = [IS_NOT_EMPTY(error_message='Password needed!'),IS_STRONG(min=7, special=0, upper=0, number=0), CRYPT()] and I cannot reproduce your problem. :-( There is something else in the logic that is passing a non-string to IS_STRONG()(

[web2py] Re: Working with custom form

2012-07-13 Thread Chris
> I really need to see the models where you set IS_STRONG. > Somehow the value passed to the validator is not a string so the validator > chokes. This can be fixed in IS_STRONG.__call__ by setting value = > str(value) but I would like to understand why it is happening. Sure, this is the rele

[web2py] Re: Working with custom form

2012-07-13 Thread Massimo Di Pierro
I really need to see the models where you set IS_STRONG. Somehow the value passed to the validator is not a string so the validator chokes. This can be fixed in IS_STRONG.__call__ by setting value = str(value) but I would like to understand why it is happening. On Friday, 13 July 2012 11:06:29

[web2py] Re: Working with custom form

2012-07-13 Thread Chris
Any further suggestion to what causes the error I'm seeing? Thanks!

[web2py] Re: Working with custom form

2012-07-09 Thread Chris
> which web2py version? Do you have a custom auth_user table? Looks like > something wrong with the list of validators for a field containing the > IS_UPPER validator. This is on 1.99.7 stable. I do have two extra field to the auth_user table, and use a custom name instead of 'auth_user', bu

[web2py] Re: Working with custom form

2012-07-08 Thread Anthony
As was mentioned earlier, if you're going to create a custom form like that, in place of , you need to include {{=form.custom.end}}. The reason is that web2py forms include two hidden fields, _formname and _formkey, and form.custom.end will add those hidden fields. They are used to protect agai

[web2py] Re: Working with custom form

2012-07-08 Thread Chris
Now I have the custom page (e.g. register) appears correctly, however, when I submit the form nothing happens - the form just clears itself with no error msg or anything. My 'register' action in controller is: def register(): return dict(form=auth.register()) My 'layout.html' is as follow

[web2py] Re: Working with custom form

2012-07-08 Thread Anthony
> > Cool. But is there way to configure the tag of a specific view page > that extends the 'layout.html'? For example, for my custom view, I want its > body tag to be like: > > > > Is it possible to configure such thing? Thanks! > and in the view: {{body_class = 'my_css_class'}} {{extend '

[web2py] Re: Working with custom form

2012-07-08 Thread Chris
> Right, you don't need a body tag in the view either. In layout.html, there > should be an {{include}} -- that gets replaced with the entire contents > of the view that extends the layout. Cool. But is there way to configure the tag of a specific view page that extends the 'layout.html'? F

[web2py] Re: Working with custom form

2012-07-08 Thread Anthony
The layout also include a section, does this mean that in my custom > view I shouldn't have another section such that I should just write > all the custom html content without tags? > Right, you don't need a body tag in the view either. In layout.html, there should be an {{include}} -- tha

[web2py] Re: Working with custom form

2012-07-08 Thread Chris
> No, because the layout already includes a section. The content of > the view gets inserted in the layout.html file at the point of the > {{include}}, which presumably is not in the head. The layout also include a section, does this mean that in my custom view I shouldn't have another se

[web2py] Re: Working with custom form

2012-07-07 Thread Anthony
> > 1. I want to utilize 'layout.html' to some extent such that it stores some > common css files for the rest of the view pages. Kinda like a shared base > template, and I want to add page-specific css (or js) files on individual > html view page. Is it as simple as including: > > {{extend lay

[web2py] Re: Working with custom form

2012-07-07 Thread Chris
> {{=form.custom.begin}} > #in between the opening and closing tags put in your normal html code and > make sure the element names corresponds to the column names as defined in > your database. web2py will handle the rest automatically. This is the most > flexible way while still making use of

Re: [web2py] Re: Working with custom form

2012-07-05 Thread Anthony
> > When I used customform for login, it won't give me any errors to be shown > whenever the password was invalid or email is not existing. I put it on > jquery mobile website. Any idea? > Just to clarify, if you let web2py serialize the form widgets (i.e., using {{=form}} or {{=form.custom.wid

Re: [web2py] Re: Working with custom form

2012-07-05 Thread Kenny Chung
When I used customform for login, it won't give me any errors to be shown whenever the password was invalid or email is not existing. I put it on jquery mobile website. Any idea? On Jul 4, 2012 4:25 PM, "Anthony" wrote: > If you refuse to use web2py's css and js files, remember that >> response.f

[web2py] Re: Working with custom form

2012-07-04 Thread Anthony
> > If you refuse to use web2py's css and js files, remember that > response.flash and session.flash wont work > Well, the flash message won't *display*, but it's easy to add some very minimal JS code to get it to display. > and also your validators also wont work. so you would have to handl

[web2py] Re: Working with custom form

2012-07-04 Thread Pystar
Hi Chris, I think Max just beat me in posting the solution. Thats the way I implemented by custom forms. Have the controller send the form to the view like def controller(): return dict(form=form) in your view just do {{=form.custom.begin}} #in between the opening and closing tags put in

[web2py] Re: Working with custom form

2012-07-04 Thread Massimo Di Pierro
Given this > > def register(): > return dict(form=auth.register()) > > you view just needs: {{=form}} > > ... > > >First name* > >Last name* > >Email* > > > > > > > ... > > But you need to replace with {{=form.cus