You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
(8) |
Nov
(9) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(13) |
May
(34) |
Jun
(7) |
Jul
(6) |
Aug
(1) |
Sep
(23) |
Oct
(37) |
Nov
(41) |
Dec
(39) |
| 2006 |
Jan
(19) |
Feb
(1) |
Mar
(5) |
Apr
(9) |
May
(3) |
Jun
(8) |
Jul
(6) |
Aug
(12) |
Sep
(15) |
Oct
(26) |
Nov
(7) |
Dec
(11) |
| 2007 |
Jan
(12) |
Feb
(6) |
Mar
(13) |
Apr
(14) |
May
(12) |
Jun
(8) |
Jul
(3) |
Aug
|
Sep
(4) |
Oct
(19) |
Nov
(9) |
Dec
|
| 2008 |
Jan
(14) |
Feb
(3) |
Mar
(11) |
Apr
(6) |
May
(18) |
Jun
(15) |
Jul
(1) |
Aug
(23) |
Sep
(18) |
Oct
(39) |
Nov
(11) |
Dec
(16) |
| 2009 |
Jan
(8) |
Feb
(9) |
Mar
(33) |
Apr
(16) |
May
(5) |
Jun
(3) |
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(6) |
Nov
(11) |
Dec
(2) |
| 2010 |
Jan
(2) |
Feb
(4) |
Mar
|
Apr
|
May
(2) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(36) |
Sep
(8) |
Oct
(1) |
Nov
|
Dec
(10) |
| 2012 |
Jan
(3) |
Feb
(5) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(10) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
(4) |
| 2015 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(1) |
Nov
(2) |
Dec
|
| 2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ian B. <ia...@co...> - 2005-09-02 15:54:56
|
On Sep 2, 2005, at 3:42 AM, deelan wrote:
> While on IRC #cherrypy channel John Speno raised an interesting
> question about how to instruct FormEncode to deal with the typical page
> containing a series of items (perhaps formatted as a table) with a
> checkbox on the left.
>
> Typical usage of such page is that user may want to remove a lot of
> messages at once (think about a webmail application) without the pain
> to go thru each ipotethical item edit form and click the correspoding
> "Delete" button.
>
> Page is something like that:
>
> [ ] Item1
> [x] Item2
> [ ] ...
> [x] ItemN
>
> [Delete selected items]
>
> The validation rule is simple: validation is successful when users
> selects one or more checkboxes; validation fails if user doesn't select
> any checkbox.
>
> Doing that in the without FormEncode aid it's far from optimal. Suppose
> to have an handler called "delete" that receive the list of selected
> items:
>
> @expose
> def delete(selected_items=[]):
> # ... do whatever you want with selected_items ...
>
> response.redirect("/")
>
> and some markup like this:
>
> <form action="/delete" method="post">
> <label><input type="checkbox" name="selected_items" value="1" />
> Item1</label>
> <label><input type="checkbox" name="selected_items" value="2" />
> Item2</label>
> ...
> <label><input type="checkbox" name="selected_items" value="N" />
> ItemN</label>
> ...
> </form>
>
> It's tricky to make everything to work, simply because you have to deal
> with three scenarios:
>
> 1) User doesn't select anything at all, hence browser will send nothing
> to the delete handler. Using a default value for selected_items you end
> up having selected_items as an empty list (and that's fine for our
> purposes).
> 2) User selects just one item. Browser sends one "selected_items" key
> and set its value to a *string* object, taken directly from the
> corresponding <input>'s value attr.
There's a Set validator that should handle this. Though looking at it,
it should also have if_missing=() as the default, since that will
handle 1. as well. Anyway, committed that in r970.
> 3) User select multiple items, hence selected_items is a *list of
> strings*.
>
> Scenario #2 is really annoying and breaks things up. Writing ad-hoc
> code each time you have to deal with that "row of checkboxes" is
> annoying so i was wondering if a kind of FE validator can be written to
> state "such list must have at least one item, please take care of point
> #2)" or in other words "List cannot be empty, please take care of point
> #2)".
>
|
|
From: Ian B. <ia...@co...> - 2005-08-15 02:59:23
|
I finally released FormEncode for real: http://cheeseshop.python.org/pypi/FormEncode I didn't really do anything to it; I guess it's fine as it is. I still have to update the website. Blah, stupid web, who needs it. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: Kevin D. <da...@gm...> - 2005-07-19 11:42:34
|
On 7/18/05, Jo=E3o Paulo Fernandes Farias <jpa...@gm...> wrote:
>
> I'm interested in FormEncode and how I can validate SQLObject attributes.
>=20
> I mean, if I have two SQLObject classes:
>=20
> class A(SQLObject):
> a =3D StringCol()
>=20
> class B(SQLObject):
> b =3D StringCol()
> a =3D ForeignKey('A')
>=20
> How can I validate the 'a' attribute of 'B' class?
You would probably put your validation logic in a "_set_a" method on B.
Kevin
|
|
From: <jpa...@gm...> - 2005-07-18 18:49:15
|
Hi!
I'm interested in FormEncode and how I can validate SQLObject attributes.
I mean, if I have two SQLObject classes:
class A(SQLObject):
a =3D StringCol()
class B(SQLObject):
b =3D StringCol()
a =3D ForeignKey('A')
How can I validate the 'a' attribute of 'B' class?
Thanks,=20
--
JP
|
|
From: Ian B. <ia...@co...> - 2005-07-12 17:04:45
|
Kazansky, Stella (SKAZANSK) wrote: > Ian, > We are using formencode package to validate our forms created usin > ZPTKit templates. > The question is: based on the exaples I saw the validators for the > fields have to match the field names in the form, like: > title = validators.String(not_empty=True) where "title" is a form > element name. > In my case the field name is created dynamically based on the data > passed in the request. > How can I validate such a field? Well, it depends on why you are creating the field names dynamically. If it's because of repeating field names, you can use the fieldname-number notation, and use the ForEach validator (which will apply its sub-validator to each set of fields based on the number). If it's because you are encoding multiple pieces of data to go together (e.g., article ID encoded into field name, article title as field content) then you can turn that into two fields with an arbitrary number, e.g., article-N.id: a hidden field with the article ID; article-N.title: the text field with the accompanying title. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: Ian B. <ia...@co...> - 2005-07-12 06:02:29
|
Peter Hunt wrote: > When a checkbox is unchecked, I get a "Missing value" error in my > schema. I did a workaround by filling in all absent values as None, but > this shoudl really be fixed up. Probably it should be set if_missing=False; will that work? -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: Peter H. <flo...@gm...> - 2005-07-12 05:04:40
|
When a checkbox is unchecked, I get a "Missing value" error in my schema. I= =20 did a workaround by filling in all absent values as None, but this shoudl= =20 really be fixed up. |
|
From: Ian B. <ia...@co...> - 2005-07-01 22:59:34
|
I've applied something similar (though not quite the same). People sometimes want to use mxDateTime, even when datetime is present, so now you can configure which one you want (with datetime_module), or leave it as None and datetime will be used in preference to mxDateTime. I haven't tested it much, but it should work okay. Kevin Dangoor wrote: > I've been using the standard datetime module with validators.py via a > monkeypatch for a while, and I figured it was about time to do a real > patch. This is a simple approach that should not break backward > compatibility for anyone using mxDateTime. > > Index: validators.py > =================================================================== > --- validators.py (revision 821) > +++ validators.py (working copy) > @@ -35,6 +35,15 @@ > > True, False = (1==1), (0==1) > > +def importDateTime(): > + global DateTime > + try: > + from mx import DateTime > + except ImportError: > + import datetime > + datetime.DateTime = datetime.datetime > + DateTime = datetime > + > ############################################################ > ## Wrapper Validators > ############################################################ > @@ -709,7 +718,7 @@ > value, state) > if self.after_now: > if DateTime is None: > - from mx import DateTime > + importDateTime() > now = DateTime.now() > if value < now: > date_formatted = now.strftime( > @@ -1117,10 +1126,7 @@ > global DateTime > FancyValidator.__init__(self, *args, **kw) > if DateTime is None: > - try: > - from mx import DateTime > - except ImportError: > - import DateTime > + importDateTime() > assert DateTime, ( > "You must have mxDateTime installed to use DateConverter") > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click > _______________________________________________ > FormEncode-discuss mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formencode-discuss -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: Ian B. <ia...@co...> - 2005-06-30 20:00:19
|
David Driver wrote: > It declares a few classes that has names starting with I. The classes > set some docmentation information. I see them imported in a few > modules. I don't see them subclassed or used. I was just interested in > what they were for. At one time FormEncode was using PyProtocols, and so interfaces were written for that. And apparently some imports are hanging around too. I left them in for documentation purposes, but they are not otherwise used. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: David D. <cou...@gm...> - 2005-06-24 15:39:56
|
It declares a few classes that has names starting with I. The classes set some docmentation information. I see them imported in a few modules. I don't see them subclassed or used. I was just interested in what they were for. Thanks! --=20 *********************************** See there, that wasn't so bad. *********************************** |
|
From: David D. <cou...@gm...> - 2005-06-24 13:30:52
|
Here is a small snip of code from datetime import datetime import formencode from formencode import validators v =3D validators.DateConverter() n =3D datetime.now() i =3D 123 print v.from_python(n) # and all is good print v.from_python(i) # and we get an attribute error # not formencode.Invalid Why do I get an attribute error instead of an invalid error? It seems to me that 123 is not a valid datetime value so it should raise formencode.Invalid. --=20 *********************************** See there, that wasn't so bad. *********************************** |
|
From: Kevin D. <da...@gm...> - 2005-06-22 14:35:34
|
I've been using the standard datetime module with validators.py via a
monkeypatch for a while, and I figured it was about time to do a real
patch. This is a simple approach that should not break backward
compatibility for anyone using mxDateTime.
Index: validators.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- validators.py (revision 821)
+++ validators.py (working copy)
@@ -35,6 +35,15 @@
=20
True, False =3D (1=3D=3D1), (0=3D=3D1)
=20
+def importDateTime():
+ global DateTime
+ try:
+ from mx import DateTime
+ except ImportError:
+ import datetime
+ datetime.DateTime =3D datetime.datetime
+ DateTime =3D datetime
+
############################################################
## Wrapper Validators
############################################################
@@ -709,7 +718,7 @@
value, state)
if self.after_now:
if DateTime is None:
- from mx import DateTime
+ importDateTime()
now =3D DateTime.now()
if value < now:
date_formatted =3D now.strftime(
@@ -1117,10 +1126,7 @@
global DateTime
FancyValidator.__init__(self, *args, **kw)
if DateTime is None:
- try:
- from mx import DateTime
- except ImportError:
- import DateTime
+ importDateTime()
assert DateTime, (
"You must have mxDateTime installed to use DateConverter")
|
|
From: Ben B. <be...@gr...> - 2005-06-17 17:43:18
|
Right now, as FormEncode uses HTMLParser to fill out a form, I'm curious how much memory and CPU this eats up as well as how fast it is. While I'll admit I haven't benchmarked it so far, I'm wondering if any thought has been given to switching to a faster parser, such as cElementTree ( http://effbot.org/zone/celementtree.htm). While this would increase the dependencies required, it does seem like a faster tree parsing scheme than what HTMLParser does. The main drawback I can think of is some of the other parsers are a lot more sensitive to having a well formed XML chunk to work with. Is there any interest in speeding up the parsing of the form, or is it deemed "fast enough" as is? - Ben |
|
From: Ian B. <ia...@co...> - 2005-06-14 18:14:39
|
These are applied in r818. I made <input type="image"> work like <input
type="submit">, except a value in the input will replace the src attribute.
Ben Bangert wrote:
> Htmlform I believe is importing Invalid from a no longer existent location.
> Here's the appropriate patch to fix it:
>
> Index: htmlform.py
> ===================================================================
> --- htmlform.py (revision 817)
> +++ htmlform.py (working copy)
> @@ -25,7 +25,7 @@
>
> import htmlfill
> import htmlfill_schemabuilder
> -from validator import Invalid
> +from api import Invalid
>
> class HTMLForm(object):
>
>
> If you were using formencode before the name switch, it still works as the
> validator package name exists. If you clear out the old formencode before
> the name switch, it will break indicating that Invalid is not around.
>
> Htmlfill.py has issues if you have an image submit button. This patch makes
> it ignore image controls which remedies the situation, maybe there's a
> better way but this is working for me.
>
> Index: htmlfill.py
> ===================================================================
> --- htmlfill.py (revision 817)
> +++ htmlfill.py (working copy)
> @@ -225,6 +225,8 @@
> self.write_tag('input', attrs, startend)
> self.skip_next = True
> self.add_key(name)
> + elif t == 'image':
> + pass
> else:
> assert 0, "I don't know about this kind of <input>: %s (pos:
> %s)" \
> % (t, self.getpos())
>
> - Ben
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> FormEncode-discuss mailing list
> For...@li...
> https://lists.sourceforge.net/lists/listinfo/formencode-discuss
--
Ian Bicking / ia...@co... / http://blog.ianbicking.org
|
|
From: Ben B. <be...@gr...> - 2005-06-14 17:57:19
|
Htmlform I believe is importing Invalid from a no longer existent location.
Here's the appropriate patch to fix it:
Index: htmlform.py
===================================================================
--- htmlform.py (revision 817)
+++ htmlform.py (working copy)
@@ -25,7 +25,7 @@
import htmlfill
import htmlfill_schemabuilder
-from validator import Invalid
+from api import Invalid
class HTMLForm(object):
If you were using formencode before the name switch, it still works as the
validator package name exists. If you clear out the old formencode before
the name switch, it will break indicating that Invalid is not around.
Htmlfill.py has issues if you have an image submit button. This patch makes
it ignore image controls which remedies the situation, maybe there's a
better way but this is working for me.
Index: htmlfill.py
===================================================================
--- htmlfill.py (revision 817)
+++ htmlfill.py (working copy)
@@ -225,6 +225,8 @@
self.write_tag('input', attrs, startend)
self.skip_next = True
self.add_key(name)
+ elif t == 'image':
+ pass
else:
assert 0, "I don't know about this kind of <input>: %s (pos:
%s)" \
% (t, self.getpos())
- Ben
|
|
From: Hancock, D. \(DHANCOCK\) <DHA...@ar...> - 2005-05-31 21:06:57
|
We just retrieved revision 808 of FormEncode from the Subversion repository, and it seems to have fixed the prlblem where text was disappearing. (It also fixed another instance we found where text between two input tags would get lost.) We're still wondering about Item 2 below (getting a top-of-the form--or wherever--notification that one or more fields failed validation). If there's interest, we can post our hack to get that notification to work. I'm not sure it's very pretty, though. Cheers!=20 --=20 David Hancock | dha...@ar... | 410-266-4384=20 ________________________________ From: Hancock, David (DHANCOCK) Sent: Sat 5/28/2005 6:10 PM To: 'for...@li...' Cc: Mishler, Karen (KMISHLER); Bolt, Scott (SBOLT) Subject: FW: Question about FormEncode I posted message below to the Webware list, but it's a FormEncode question. We've got two questions now, and would be grateful for assistance with either or both: 1. (See below). How can we avoid the problem of select option lists losing the text between the option tags?=20 2. What's the best way to get a message at the top of the html for a form if any of the validators fail? This is one of the things we liked about FunFormKit, and we've got it working in FormEncode by defining a new tag. There's probably a better way. Cheers!=20 --=20 David Hancock | dha...@ar... | 410-266-4384=20 -----Original Message-----=20 From: Hancock, David (DHANCOCK) =20 Sent: Thursday, May 26, 2005 6:20 PM=20 To: web...@li...=20 Cc: Mishler, Karen (KMISHLER); Bolt, Scott (SBOLT)=20 Subject: Question about FormEncode=20 Much much progress today with ZPTs and FormEncode. Here's the latest set of questions from our team--suggestions and corrections gratefully accepted: I am having a problem with formencode:=20 When I feed html to into an htmlfill.FillingParser instance, this piece of the html=20 <select name=3D"aircraft"><option value=3D"N103XA"> N103XA = </option><option value=3D"N104XA"> N104XA </option><option value=3D"N105XA"> N105XA </option></select>=20 becomes=20 <select name=3D"aircraft"><option value=3D"N103XA"></option><option value=3D"N104XA"></option><option value=3D"N105XA"></option></select>=20 I commented out this line in the handle_option function in htmlfill.py:=20 self.skip_next =3D True=20 When I ran it again with the same html input, I got this (which is correct):=20 <select name=3D"aircraft"><option value=3D"N103XA"><option = value=3D"N103XA"> N103XA </option><option value=3D"N104XA"><option value=3D"N104XA"> = N104XA </option><option value=3D"N105XA"><option value=3D"N105XA"> N105XA </option></select>=20 I tried running the same piece of html through, but with carriage return line feeds after some of the options (this was generated by a zpt template)=20 <select name=3D"aircraft"><option=20 value=3D"N103XA"> N103XA </option><option value=3D"N104XA"> N104XA </option><option=20 value=3D"N105XA"> N105XA </option></select>=20 becomes=20 <select name=3D"aircraft"><option value=3D"N103XA"><option value=3D"N103XA"> N103XA </option><option value=3D"N104XA"><option value=3D"N104XA"> N104XA </option><option value=3D"N105XA"><option value=3D"N105XA"> N105XA </option></select>=20 Cheers!=20 --=20 David Hancock | dha...@ar... | 410-266-4384=20 |
|
From: Lorenzo B. <lbo...@gm...> - 2005-05-28 23:32:18
|
Hi all, new to this list. Could anybody provide some even basic examples of FormEncode working with CherryPy? Thanks, Lorenzo |
|
From: Lorenzo B. <lbo...@gm...> - 2005-05-28 23:30:30
|
Jason Culverhouse wrote:=20 >The svn head (806) installer is broken. Here is a patch that I think=20 >fixes the problem. Yup! I can confirm that it works! Thanks for the patch Jason Lorenzo |
|
From: Hancock, D. \(DHANCOCK\) <DHA...@ar...> - 2005-05-28 22:10:47
|
I posted message below to the Webware list, but it's a FormEncode question. We've got two questions now, and would be grateful for assistance with either or both: 1. (See below). How can we avoid the problem of select option lists losing the text between the option tags? 2. What's the best way to get a message at the top of the html for a form if any of the validators fail? This is one of the things we liked about FunFormKit, and we've got it working in FormEncode by defining a new tag. There's probably a better way. Cheers! -- David Hancock | dha...@ar... | 410-266-4384=20 > -----Original Message----- > From: Hancock, David (DHANCOCK) =20 > Sent: Thursday, May 26, 2005 6:20 PM > To: web...@li... > Cc: Mishler, Karen (KMISHLER); Bolt, Scott (SBOLT) > Subject: Question about FormEncode >=20 > Much much progress today with ZPTs and FormEncode. Here's the latest > set of questions from our team--suggestions and corrections gratefully > accepted: >=20 > I am having a problem with formencode:=20 > When I feed html to into an htmlfill.FillingParser instance, this > piece of the html=20 > <select name=3D"aircraft"><option value=3D"N103XA"> N103XA > </option><option value=3D"N104XA"> N104XA </option><option > value=3D"N105XA"> N105XA </option></select>=20 > becomes=20 > <select name=3D"aircraft"><option value=3D"N103XA"></option><option > value=3D"N104XA"></option><option value=3D"N105XA"></option></select>=20 > I commented out this line in the handle_option function in > htmlfill.py:=20 > self.skip_next =3D True=20 > When I ran it again with the same html input, I got this (which is > correct):=20 > <select name=3D"aircraft"><option value=3D"N103XA"><option = value=3D"N103XA"> > N103XA </option><option value=3D"N104XA"><option value=3D"N104XA"> = N104XA > </option><option value=3D"N105XA"><option value=3D"N105XA"> N105XA > </option></select>=20 > I tried running the same piece of html through, but with carriage > return line feeds after some of the options (this was generated by a > zpt template)=20 > <select name=3D"aircraft"><option=20 > value=3D"N103XA"> N103XA </option><option value=3D"N104XA"> N104XA > </option><option=20 > value=3D"N105XA"> N105XA </option></select>=20 > becomes=20 > <select name=3D"aircraft"><option value=3D"N103XA"><option > value=3D"N103XA"> N103XA </option><option value=3D"N104XA"><option > value=3D"N104XA"> N104XA </option><option value=3D"N105XA"><option > value=3D"N105XA"> N105XA </option></select> >=20 >=20 > Cheers! > -- > David Hancock | dha...@ar... | 410-266-4384=20 >=20 |
|
From: Jason C. <ja...@me...> - 2005-05-26 20:54:27
|
Ian,
The svn head (806) installer is broken. Here is a patch that I think
fixes the problem.
Would you rather have me log these as bugs on sourceforge?
Jason
Index: setup.py
===================================================================
--- setup.py (revision 806)
+++ setup.py (working copy)
@@ -28,7 +28,7 @@
url="http://svn.colorstudy.com/Formencode/trunk",
license="PSF",
packages=["formencode", "formencode.util"],
- package_data={'formencode': 'javascript/'},
+ package_data={'formencode': ['javascript/*']},
download_url="@@",
)
|
|
From: Shannon -jj B. <jj...@gm...> - 2005-05-25 18:40:21
|
Hmm, we have a very similar mechanism in Aquarium, so I'm going to make a few comments: On 5/25/05, Ian Bicking <ia...@co...> wrote: > michelts wrote: > >>It might be better to use > >>Webware actions instead of another action system, but I don't know if > >>there's any conflict there. > > > > > > There isn't any conflict with webware actions and the fecomponent > > actions, fecomponent actions look like this: > > > > def someaction(self, fields): > > pass > > > > I don't know if I can merge it with the webware actions and still be a > > plug-in component. >=20 > If you can list all the actions up front, you should be able to using > the actions() method of the component itself (which is added to the > servlet's actions()). Do you really need to make the list explicit? Just look for everything in self matching your naming convention. > >>Is there a default action? For instance, when the user hits Enter > >>without hitting a button, no submit button will be triggered. Is the > >>first action listed in actionList the default? > > > > > > Sorry, I doesn't documented it yet, I will do it tomorrow, the actions > > should use like this: >=20 > I don't think this is what I meant. If you have an action.ok and an > action.cancel, I believe when you hit Enter in the form (instead of > clicking a button) that neither of these fields will show up in the > request fields -- in that case, one of the actions should be considered > clicked by default. Yes, we had to deal with the deadly enter key as well. We do this by having a hidden form field with the default action to be executed. If the user submits the form, that action gets executed. If he clicks a different button, you can change which action gets executed (either via server side code or via JavaScript that changes the value of the hidden variable). I won't send the code because it's not very interesting. Hopefully you get the idea. > >>It looks like processForm() calls on*Click. So the flow typically goes= : > >> > >>def writeHTML(self): > >> self.processForm() --> calls on*Click if form is submitted and val= id > >> do stuff to write the form > >> > >>then in sleepEvent parseDocument loads the page that was written and > >>rewrites the form with htmlfill. > > > > > > You doesn't need to use self.processForm (unless a special case), the > > processForm is called automatically in the sleepEvent by the > > parseDocument. > > > > the special case is if you want to output some data from the > > on*Clicked, this way you may call processForm when you want your > > method called (like in FunFormKit). >=20 > To me it would make more sense if processForm was called on awake or > respond -- sleep seems much too late in the cycle. Hrm... I don't think > there's a way to call an event just *after* the servlet's awake is > processed (in Wareweb I added this), but that's where I think it > belongs. Maybe cpage should be extended to add another event. >=20 > >>But anyway, it looks pretty easy to use, and I like parseDocument is > >>very output-neutral. > > > > > > Yes, I use it with zptkit, but you can use another component > > compatible template system or you can write direct from scratch, I use > > a variant of fecomponent with cheetah, but it is a servlet while there > > isn't a way to use components with cheetah. >=20 > Yeah, that's too bad. I'd really like if there was a Cheetah component > -- I don't think it would be hard to write, and would look very similar > to ZPTKit.zptcomponent. >=20 > >> I can't remember if I ever set you up with svn access for > >>FormEncode? This could also go in svn.w4py.org. > > > > > > Where do you prefer? > > Sorry about anything I done wrong, the fecomponent make use of > > validator package, I didn't have time to update it, I will update it > > tomorrow... >=20 > Maybe svn.w4py.org is better; colorstudy.com has been having problems. > If you want to send me a username and password (offlist ;), or a line > for htpasswd, I can add you. Best Regards, -jj --=20 I have decided to switch to Gmail, but messages to my Yahoo account will still get through. |
|
From: Ian B. <ia...@co...> - 2005-05-25 17:27:32
|
michelts wrote: >>It might be better to use >>Webware actions instead of another action system, but I don't know if >>there's any conflict there. > > > There isn't any conflict with webware actions and the fecomponent > actions, fecomponent actions look like this: > > def someaction(self, fields): > pass > > I don't know if I can merge it with the webware actions and still be a > plug-in component. If you can list all the actions up front, you should be able to using the actions() method of the component itself (which is added to the servlet's actions()). >>Is there a default action? For instance, when the user hits Enter >>without hitting a button, no submit button will be triggered. Is the >>first action listed in actionList the default? > > > Sorry, I doesn't documented it yet, I will do it tomorrow, the actions > should use like this: I don't think this is what I meant. If you have an action.ok and an action.cancel, I believe when you hit Enter in the form (instead of clicking a button) that neither of these fields will show up in the request fields -- in that case, one of the actions should be considered clicked by default. >>It looks like processForm() calls on*Click. So the flow typically goes: >> >>def writeHTML(self): >> self.processForm() --> calls on*Click if form is submitted and valid >> do stuff to write the form >> >>then in sleepEvent parseDocument loads the page that was written and >>rewrites the form with htmlfill. > > > You doesn't need to use self.processForm (unless a special case), the > processForm is called automatically in the sleepEvent by the > parseDocument. > > the special case is if you want to output some data from the > on*Clicked, this way you may call processForm when you want your > method called (like in FunFormKit). To me it would make more sense if processForm was called on awake or respond -- sleep seems much too late in the cycle. Hrm... I don't think there's a way to call an event just *after* the servlet's awake is processed (in Wareweb I added this), but that's where I think it belongs. Maybe cpage should be extended to add another event. >>But anyway, it looks pretty easy to use, and I like parseDocument is >>very output-neutral. > > > Yes, I use it with zptkit, but you can use another component > compatible template system or you can write direct from scratch, I use > a variant of fecomponent with cheetah, but it is a servlet while there > isn't a way to use components with cheetah. Yeah, that's too bad. I'd really like if there was a Cheetah component -- I don't think it would be hard to write, and would look very similar to ZPTKit.zptcomponent. >> I can't remember if I ever set you up with svn access for >>FormEncode? This could also go in svn.w4py.org. > > > Where do you prefer? > Sorry about anything I done wrong, the fecomponent make use of > validator package, I didn't have time to update it, I will update it > tomorrow... Maybe svn.w4py.org is better; colorstudy.com has been having problems. If you want to send me a username and password (offlist ;), or a line for htpasswd, I can add you. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: michelts <mic...@gm...> - 2005-05-25 17:10:08
|
Hi Ian,
> It might be better to use
> Webware actions instead of another action system, but I don't know if
> there's any conflict there.
There isn't any conflict with webware actions and the fecomponent
actions, fecomponent actions look like this:
def someaction(self, fields):
pass
I don't know if I can merge it with the webware actions and still be a
plug-in component.
> Is there a default action? For instance, when the user hits Enter
> without hitting a button, no submit button will be triggered. Is the
> first action listed in actionList the default?
Sorry, I doesn't documented it yet, I will do it tomorrow, the actions
should use like this:
class MyServlet(SitePage):
actionList =3D ['ok', 'cancel']
def onOkClicked(self, fields):
pass
def onCancelClicked(self, fields):
pass
and the html code should have:
<form>
<input type=3D"submit" name=3D"action.ok" value=3D"Ok">
<input type=3D"submit" name=3D"action.cancel" value=3D"Cancel">
</form>
I didn't do a way to specify the method name, maybe it is a TODO :),
If you don't want to specify the actions, you can use:
<form>
<input type=3D"submit" value=3D"Ok">
</form>
def processFormData(self, fields):
pass # this is the default action handler
> It looks like processForm() calls on*Click. So the flow typically goes:
>=20
> def writeHTML(self):
> self.processForm() --> calls on*Click if form is submitted and valid
> do stuff to write the form
>=20
> then in sleepEvent parseDocument loads the page that was written and
> rewrites the form with htmlfill.
You doesn't need to use self.processForm (unless a special case), the
processForm is called automatically in the sleepEvent by the
parseDocument.
the special case is if you want to output some data from the
on*Clicked, this way you may call processForm when you want your
method called (like in FunFormKit).
I send a example to the list with a site I doing, the "Contato" page
(to Contact) made use of FEComponent...
> But anyway, it looks pretty easy to use, and I like parseDocument is
> very output-neutral.
Yes, I use it with zptkit, but you can use another component
compatible template system or you can write direct from scratch, I use
a variant of fecomponent with cheetah, but it is a servlet while there
isn't a way to use components with cheetah.
> I can't remember if I ever set you up with svn access for
> FormEncode? This could also go in svn.w4py.org.
Where do you prefer?
Sorry about anything I done wrong, the fecomponent make use of
validator package, I didn't have time to update it, I will update it
tomorrow...
regards,
--=20
Michel Thadeu Sabchuk
Curitiba - Brasil
|
|
From: Ian B. <ia...@co...> - 2005-05-25 16:27:27
|
I'm sorry, I haven't been very attentive of FormEncode in the last couple weeks. I searched through my mailbox, and applied the things I could find. Scott Chapman sent me some htmlfill changes which I wasn't able to apply, since they weren't in diff form and they'd become too out of sync with my copy of htmlfill -- and I'm not sure if Jason's htmlfill patches resolved the same XHTML-related issues. There's no patches or bugs on SF either. So, if anyone has anything out there, please send it in (again), because I've now officially forgotten everything pending ;) -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
|
From: Ian B. <ia...@co...> - 2005-05-25 16:24:30
|
Hi Michel -- sorry I've been so slow to look at FEComponent.
I noticed you added in Action. That's something that was built into
FormEncode before, but got lost in the shuffle when form generatino (and
Submit) went away. I think it's probably correct to put it in at this
level instead of directly in FormEncode. It might be better to use
Webware actions instead of another action system, but I don't know if
there's any conflict there. There shouldn't be, really -- components
can add new actions. Though, looking at it, there's no documentation
for this. Anyway, you'd do (in the Component subclass):
_servletMethods = ['submit_action', ...]
def actions(self):
return ['submit_action']
Is there a default action? For instance, when the user hits Enter
without hitting a button, no submit button will be triggered. Is the
first action listed in actionList the default?
It looks like processForm() calls on*Click. So the flow typically goes:
def writeHTML(self):
self.processForm() --> calls on*Click if form is submitted and valid
do stuff to write the form
then in sleepEvent parseDocument loads the page that was written and
rewrites the form with htmlfill.
But anyway, it looks pretty easy to use, and I like parseDocument is
very output-neutral. It would be good to get this in a public
repository. I can't remember if I ever set you up with svn access for
FormEncode? This could also go in svn.w4py.org.
--
Ian Bicking / ia...@co... / http://blog.ianbicking.org
|