[Kss-devel] Marshalling of form data
Hedley Roos
hedley at upfrontsystems.co.za
Thu Feb 22 15:10:03 CET 2007
This applies to azax 1.1.alpha1
I am working on a project using PloneAzax and I make use of marshalling
(:list, :record, :records) in my page templates. Azax cannot handle
this, which means that in my Python scripts I do not have access to the
structures. There are other ugly solutions like assembling special tag
attributes and decoding them, but I wanted a clean solution.
I heavily modified forms.js and kukit.js and made a single char change
to resourcedata.js. See attached patches and examples to understand the
discussion below.
In my KSS file I had to make use of a naming convention. For exmaple
consider the line
kss_MarshallTest-value_record|record: currentFormVar('arecord:record')
I have to name the form var with its marshalling, hence arecord:record.
The actual form elements will be called something like
arecord.foo:record of course.
And I had to use a pipe in value_record|record since a colon breaks the
KSS parsing. The |record denotes the marshal type.
The page templates and scripts are for use in a Plone site. I didn't
have time to strip Plone away and use only Zope for the test page.
My additions do not seem to break anything.
Oh, the regexp's in the Javascript are not very elegant. Sorry. And I
can't handle :int marshalling yet. Todo.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: forms.js.patch
Url: http://codespeak.net/pipermail/kss-devel/attachments/20070222/d5040474/attachment-0005.diff
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kss_MarshallTest.py
Url: http://codespeak.net/pipermail/kss-devel/attachments/20070222/d5040474/attachment-0006.diff
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kukit.js.patch
Url: http://codespeak.net/pipermail/kss-devel/attachments/20070222/d5040474/attachment-0007.diff
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: marshalltest.kss.dtml
Url: http://codespeak.net/pipermail/kss-devel/attachments/20070222/d5040474/attachment-0008.diff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/kss-devel/attachments/20070222/d5040474/attachment-0001.htm
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: resourcedata.js.patch
Url: http://codespeak.net/pipermail/kss-devel/attachments/20070222/d5040474/attachment-0009.diff
More information about the Kss-devel
mailing list