I did it another way:
To create date input, that parses yyyy-mm-dd format and returns
datetime.date object i did:
class DateInput(web.form.Input):
def get_type(self):
return 'text'
def get_value(self):
try:
return datetime.date(*[int(i) for i in
self.value.split("-")])
except:
return None
On Oct 26, 4:31 pm, Branko Vukelic <[email protected]> wrote:
> You can add it right now yourself by subclassing the web.form.Form and
> overriding the __init__.
>
>
>
>
>
>
>
>
>
> On Tue, Oct 26, 2010 at 2:11 PM, andrei <[email protected]> wrote:
> > Branko, its definitely what I suggest.
>
> > Cannot think of Django forms since I've never used Django. I'm working
> > on a project with lots of forms in it, so this feature came up on my
> > mind independently.
>
> > On Oct 26, 2:54 pm, Branko Vukelic <[email protected]> wrote:
> >> On Tue, Oct 26, 2010 at 12:21 PM, Anand Chitipothu <[email protected]>
> >> wrote:
> >> > 2010/10/26 andrei <[email protected]>:
> >> >> I suggest one good feature for Form module — value formatters for form
> >> >> inputs.
>
> >> >> Formatter is a function that accepts inputs value and then returns any
> >> >> python object, for example Datetime object.
>
> >> >> It should be executed over values of validated Form when they are
> >> >> retrieved: form.d.some_input
>
> >> > Are we trying to reinvent django forms?
>
> >> >http://docs.djangoproject.com/en/dev/topics/forms/
>
> >> > Can someone try to see if it is possible to use django forms with web.py?
>
> >> I think Django forms pull in a LOT of crap from Django core.
>
> >> As for output formatters, I've implemented them in my fork, as I
> >> constantly find myself formatting the output.
>
> >>http://github.com/foxbunny/webpy/commit/7b20b966048486869242f24a3f0f7...
>
> >> --
> >> Branko Vukelić
>
> >> [email protected]
> >> [email protected]
>
> >> Check out my blog:http://www.brankovukelic.com/
> >> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> >> Registered Linux user #438078 (http://counter.li.org/)
> >> I hang out on identi.ca:http://identi.ca/foxbunny
>
> >> Gimp Brushmakers Guildhttp://bit.ly/gbg-group
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "web.py" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group
> > athttp://groups.google.com/group/webpy?hl=en.
>
> --
> Branko Vukelić
>
> [email protected]
> [email protected]
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.