From: Matt F. <ma...@da...> - 2002-04-17 20:05:10
|
Martin and I are making our first public release of our new "FormKit", and wanted to invite the Webware community to try it out, comment, and even participate in its further development. "FormKit" is a library plug-in for the creation, parsing, and validation of HTML forms with Webware WebKit. It is directly inspired by FunFormKit by Ian Bicking (thanks, Ian!). We have endeavored to create lots of good documentation, lots of examples, and to adhere to the Webware coding styleguide as much as possible. Please check it out! http://dalchemy.com/python/formkit/ Thanks! |
From: Bill E. <bi...@rf...> - 2002-04-18 11:04:10
|
Matt Feifarek wrote: > Martin and I are making our first public release of our new "FormKit", and > wanted to invite the Webware community to try it out, comment, and even > participate in its further development. [posted only to the devel list] Looks interesting (I'd say fun, but I think that's trademarked by Ian - how about "FreeFormKit"?). One thing I don't really see in either kit is having a template that uses regular expressions, something like: Person: <name>{1} Mandatory 1 <address>{1?} Mandatory at least 1 <phone>{1,3} Mandatory 1-3 <publications>{*} Non-mandatory <email>{1+} <fax>{1?} 0 or 1 <company>{1} Company: <companyname>{1} <companycontact>{1+} Contact: ... ... And then have the possibility for FormKit to generate additional blocks as needed, say if I want a second address block for my home office, a third for my PO Box, etc. Something that would parse a schema (Relax NG from PyXML sandbox? regular schemas using PyTrex, also in PyXML) or a DTD would fit in with my XML needs. I can see a bit how to do this on my own, but it seems like dynamic block or field generation would be a useful feature for the FormKit. -- Bill Eldridge Radio Free Asia bi...@rf... |
From: Tavis R. <ta...@re...> - 2002-04-18 16:35:26
|
Bill, your simple form-template/schema proposal is an excellent idea! Tavis On April 18, 2002 04:06 am, Bill Eldridge wrote: > Matt Feifarek wrote: > > Martin and I are making our first public release of our new "FormKit"= , > > and wanted to invite the Webware community to try it out, comment, an= d > > even participate in its further development. > > [posted only to the devel list] > > Looks interesting (I'd say fun, but I think that's trademarked > by Ian - how about "FreeFormKit"?). > > One thing I don't really see in either kit is having > a template that uses regular expressions, something like: > > Person: > <name>{1} > =09Mandatory 1 > <address>{1?} > =09Mandatory at least 1 > <phone>{1,3} > =09Mandatory 1-3 > <publications>{*}=09Non-mandatory > <email>{1+} > <fax>{1?} > =090 or 1 > <company>{1} > > Company: > <companyname>{1} > <companycontact>{1+} > > Contact: > ... > ... > > And then have the possibility for FormKit to generate > additional blocks as needed, say if I want a second > address block for my home office, a third for my > PO Box, etc. > > Something that would parse a schema (Relax NG from > PyXML sandbox? regular schemas using PyTrex, also in PyXML) > or a DTD would fit in with my XML needs. > > I can see a bit how to do this on my own, but it seems > like dynamic block or field generation would be a useful > feature for the FormKit. |
From: <ir...@ms...> - 2002-04-18 16:59:02
|
On Thu, Apr 18, 2002 at 09:51:05AM -0700, Tavis Rudd wrote: > > Looks interesting (I'd say fun, but I think that's trademarked > > by Ian - how about "FreeFormKit"?). But the fun name is so... fun. How does Ian feel about FormKit? Can it be incorporated into FunFormKit? Or latched in on the side so it can go into the same package? Or FunFormKit.Feifarek.Form ? (Of course, nobody would remember how to spell Feifarek... :) -- -Mike (Iron) Orr, ir...@ms... (if mail problems: ms...@oz...) http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol |
From: Matt F. <ma...@da...> - 2002-04-18 17:12:32
|
| But the fun name is so... fun. How does Ian feel about FormKit? | Can it be incorporated into FunFormKit? Or latched in on the side | so it can go into the same package? Or | FunFormKit.Feifarek.Form ? (Of course, nobody would remember how | to spell Feifarek... :) I get that problem a lot. :) We see FFK and FK as alternatives; they probably can't be merged in any sensible way, since they really do the same thing, but in pretty different ways. Some folks will prefer to use FFK, and we (hope) that some folks will want to try out FK. I suppose that the name issue will have to be addressed. so as to communicate that they are alternatives. |
From: Jeff J. <je...@je...> - 2002-04-18 20:14:44
|
I'm working on a new project and wanted to try out Cheetah's inheritance approach rather than containment. I found that I had to add '.tmpl' to the extensionsToIgnore setting in order to specify my servlet name in the URL without the extension. Otherwise I got 404 - Page not found but _no_ errors were reported on the WebKit stdout. This highlighted a few issues. With default Application.config settings, the WebKit output was: 1 2002-04-18 16:05:14 /partner/base 1 0.01 secs /partner/base This gives a 404 error in the browser but no error shows in stdout. If I changed UseCascadingExtensions to 0: 1 2002-04-18 16:05:56 /partner/base WARNING: For /base, did not get precisely 1 filename: ['/home/jeff/jeff/partner/www/base.tmpl', '/home/jeff/jeff/partner/www/base.py'] 1 0.01 secs /partner/base This also gives a 404 in the browser. By adding '.tmpl' to ExtensionsToIgnore, things work as expected. Since '*.tmpl' is in the default FilesToHide setting, I propose it should also be added to ExtensionsToIgnore. There seems to be 3 competing pairs of settings below that combine to produce strange behavior. Could the winner be chosen and the other two removed? 'ExtensionsToIgnore': ['.pyc', '.pyo', '.py~', '.psp~', '.html~','.bak',], #'.tmpl'], 'ExtensionsToServe': [], # if specified, only extensions in this list will be used 'UseCascadingExtensions': 0, 'ExtensionCascadeOrder':['.py','.psp','.html'], 'FilesToHide': ['.*','*~', '*.bak', '*.tmpl', '*.config', '__init__.*', '*.pyc', '*.pyo'], 'FilesToServe': [], # if specified, only files matching these patterns will be served Regards, Jeff |
From: Tavis R. <ta...@re...> - 2002-04-18 20:56:20
Attachments:
extensions.diff
|
I've attached a patch that deals with this. It'll also be up at sf.net i= n a=20 minute. Tavis On April 18, 2002 01:09 pm, Jeff Johnson wrote: > I'm working on a new project and wanted to try out Cheetah's inheritanc= e > approach rather than containment. I found that I had to add '.tmpl' to > the extensionsToIgnore setting in order to specify my servlet name in > the URL without the extension. Otherwise I got 404 - Page not found bu= t > _no_ errors were reported on the WebKit stdout. This highlighted a few > issues. > > With default Application.config settings, the WebKit output was: > > 1 2002-04-18 16:05:14 /partner/base > 1 0.01 secs /partner/base > > This gives a 404 error in the browser but no error shows in stdout. Hmm, that needs to be fixed. > If I changed UseCascadingExtensions to 0: > > 1 2002-04-18 16:05:56 /partner/base > WARNING: For /base, did not get precisely 1 filename: > ['/home/jeff/jeff/partner/www/base.tmpl', > '/home/jeff/jeff/partner/www/base.py'] > 1 0.01 secs /partner/base > > This also gives a 404 in the browser. > > By adding '.tmpl' to ExtensionsToIgnore, things work as expected. Sinc= e > '*.tmpl' is in the default FilesToHide setting, I propose it should als= o > be added to ExtensionsToIgnore. I agree. > There seems to be 3 competing pairs of settings below that combine to > produce strange behavior. Could the winner be chosen and the other two > removed? They all do different things. ExtensionsTo___ are only used when the=20 extension is not part of the URL. They are for convenience, not security. CasdadingExtensions are also there for convenience when the extensions ar= e=20 missing from the URL. FilesTo___ are used for all requests regardless of = the=20 presence of the extension. They are for security, not convenience. I do= n't=20 see anyway to combine them. > =09'ExtensionsToIgnore': ['.pyc', '.pyo', '.py~', '.psp~', > '.html~','.bak',], #'.tmpl'], > =09'ExtensionsToServe': [], # if specified, only extensions in > this list will be used > =09'UseCascadingExtensions': 0, > =09'ExtensionCascadeOrder':['.py','.psp','.html'], > =09'FilesToHide': ['.*','*~', '*.bak', '*.tmpl', '*.config', > '__init__.*', '*.pyc', '*.pyo'], > =09'FilesToServe': [], # if specified, only files matching these > patterns will be served |
From: Matt F. <ma...@da...> - 2002-04-18 17:02:07
|
This certainly looks promising, but I'm afraid that it's pretty over my head. I'm not familiar with any of the products/projects you mentioned, but we are continuously looking for better options for templating than the standard ways (isn't everyone?). We're also looking for more "automatic" ways of defining a form, or defining it algorythmically, which also seems to be related to what you've got here. XML has of course come up several times. I'm quite interested in your approach. I'll look into these projects. To TRY and answer your question, there's no reason that the behavior you're talking about couldn't be implemented. We tried very hard to let FormKit's black box be pretty transparent. A simple helper/glue function to build your template would be easy. I'll read up and try to understand your ideas. Any tips on where to start? | -----Original Message----- | From: Bill Eldridge [mailto:bi...@rf...] | Sent: Thursday, April 18, 2002 7:07 AM | To: Matt Feifarek | Cc: web...@li... | Subject: Re: [Webware-discuss] Announce: a new HTML Forms Library for | Webware WebKit | | | Matt Feifarek wrote: | > Martin and I are making our first public release of our new | "FormKit", and | > wanted to invite the Webware community to try it out, comment, and even | > participate in its further development. | | [posted only to the devel list] | | Looks interesting (I'd say fun, but I think that's trademarked | by Ian - how about "FreeFormKit"?). | | One thing I don't really see in either kit is having | a template that uses regular expressions, something like: | | Person: | <name>{1} | Mandatory 1 | <address>{1?} | Mandatory at least 1 | <phone>{1,3} | Mandatory 1-3 | <publications>{*} Non-mandatory | <email>{1+} | <fax>{1?} | 0 or 1 | <company>{1} | | Company: | <companyname>{1} | <companycontact>{1+} | | Contact: | ... | ... | | And then have the possibility for FormKit to generate | additional blocks as needed, say if I want a second | address block for my home office, a third for my | PO Box, etc. | | Something that would parse a schema (Relax NG from | PyXML sandbox? regular schemas using PyTrex, also in PyXML) | or a DTD would fit in with my XML needs. | | I can see a bit how to do this on my own, but it seems | like dynamic block or field generation would be a useful | feature for the FormKit. | | | -- | Bill Eldridge | Radio Free Asia | bi...@rf... | |
From: Bill E. <bi...@rf...> - 2002-04-18 19:14:02
|
Originally, there were DTD's in XML, which do something like: <!ELEMENT efd (vendor_call,product,model,vendid,price,tech_spec?,phy_spec?,io_spec?,rev_info?,copy,copyright,xinfo)> <!ELEMENT vendor_call (#PCDATA)> <!ELEMENT pkill_date (#PCDATA)> <!ELEMENT copy (text*)> <!ELEMENT text (sec_title*|section*|sec2_title*|section2*|graphics*)*> <!ELEMENT sec_title (#PCDATA)> <!ELEMENT copyright (#PCDATA)> <!ELEMENT xinfo (x_cad,x_doc,x_efd)> Where ? means 0 or 1, and * means 0 to infinite. But DTD's aren't XML, so they came up with schemas, doing more like: <empty/> <choice> <oneOrMore><empty/><text/><notAllowed/></oneOrMore> <zeroOrMore><empty/><text/><notAllowed/></zeroOrMore> <div> <value datatypeLibrary="XXX">foo</value> <value>foo</value> </div> RelaxNG is kind of a step beyond this, and is the marriage of Relax and Trex. The CVS for pyxml has a "sandbox" with a test version of RelaxNG for Python. More on Trex & Relax_NG are at thaiopensource.org, stuff for parsing DTD's is in the xmlproc demos from the PyXML source. But anyway, the idea of having a few of these specifiers in a Form specification: f = self.form = Form.Form() f1=fieldLibrary.TextField('name',validators=[valAtLeats3Char], label='name: ')] f2=fieldLibrary.TextField('address',validators=[valAtLeast3Char], label='name: ')] f3=fieldLibrary.TextField('phone',validators=[valAtLeast12Char], label='name: ')] block= Form.Block('Address Block',f1,[], f2,[min=1,max=3,displayAll,labelFirst], f3,[min=1,max=2,displayAll,labelAll] ) f.addBlock(block,[label='Main contact',altlabel='Alternate contact', min=1,max=4,labelFirst,altLabel=2,displayDynamic ) Thinking about in the future using an input definition file that was then in schema/relax_ng form to convert to field/block options would then allow the design on the fly - <address> <name type="char" minValue="3"> <address minValue='1' maxValue='2' minNumber='1' maxNumber='2'/> <phone minValue='12' maxValue='20' minNumber='1' maxNumber='2'/> </address> <block><contact label="Main contact" altlabel="Main contact"> <blockitem display="dynamic" minNumber='1' maxNumber='4' displayNumber="1"><address/></blockitem> </blockitem> </block> where attributes like "minNumber" can be specified in the schema, and/or overridden by the program and additional stylesheets (css's and xslt transform sheets). YEah, it gets pretty huge, but starting small with just a few options and making it structured for later might make this easier. Matt Feifarek wrote: > This certainly looks promising, but I'm afraid that it's pretty over my > head. > > I'm not familiar with any of the products/projects you mentioned, but we are > continuously looking for better options for templating than the standard > ways (isn't everyone?). > > We're also looking for more "automatic" ways of defining a form, or defining > it algorythmically, which also seems to be related to what you've got here. > > XML has of course come up several times. I'm quite interested in your > approach. I'll look into these projects. > > To TRY and answer your question, there's no reason that the behavior you're > talking about couldn't be implemented. We tried very hard to let FormKit's > black box be pretty transparent. A simple helper/glue function to build your > template would be easy. > > I'll read up and try to understand your ideas. Any tips on where to start? > > | -----Original Message----- > | From: Bill Eldridge [mailto:bi...@rf...] > | Sent: Thursday, April 18, 2002 7:07 AM > | To: Matt Feifarek > | Cc: web...@li... > | Subject: Re: [Webware-discuss] Announce: a new HTML Forms Library for > | Webware WebKit > | > | > | Matt Feifarek wrote: > | > Martin and I are making our first public release of our new > | "FormKit", and > | > wanted to invite the Webware community to try it out, comment, and even > | > participate in its further development. > | > | [posted only to the devel list] > | > | Looks interesting (I'd say fun, but I think that's trademarked > | by Ian - how about "FreeFormKit"?). > | > | One thing I don't really see in either kit is having > | a template that uses regular expressions, something like: > | > | Person: > | <name>{1} > | Mandatory 1 > | <address>{1?} > | Mandatory at least 1 > | <phone>{1,3} > | Mandatory 1-3 > | <publications>{*} Non-mandatory > | <email>{1+} > | <fax>{1?} > | 0 or 1 > | <company>{1} > | > | Company: > | <companyname>{1} > | <companycontact>{1+} > | > | Contact: > | ... > | ... > | > | And then have the possibility for FormKit to generate > | additional blocks as needed, say if I want a second > | address block for my home office, a third for my > | PO Box, etc. > | > | Something that would parse a schema (Relax NG from > | PyXML sandbox? regular schemas using PyTrex, also in PyXML) > | or a DTD would fit in with my XML needs. > | > | I can see a bit how to do this on my own, but it seems > | like dynamic block or field generation would be a useful > | feature for the FormKit. > | > | > | -- > | Bill Eldridge > | Radio Free Asia > | bi...@rf... > | -- Bill Eldridge Radio Free Asia bi...@rf... |