Forms

1 view
Skip to first unread message

shalpin

unread,
Oct 1, 2008, 8:12:52 PM10/1/08
to WikklyText
Hi

I've just started playing with WikklyText and I really like it.

One thing I was hoping to do, but can't seem to: forms.

I was hoping to be able to put a <form> with some controls on one
page, have the action point to another page and on the target page
have a <?py> .. </?py> block get the variables out of the context
object, but it seems they aren't there.

Is there some other way to get the variables for a form? If I can't do
this, is there some way to access the full uri of the page so I could
use a "get" method on the form and have my script parse them?

The reason I want to do forms is that I thought a served WikklyText
wiki might be a quick way to put a gui on some local python scripts.

Frank McIngvale

unread,
Oct 1, 2008, 9:20:23 PM10/1/08
to wikkl...@googlegroups.com
On 10/1/08, shalpin <sjha...@gmail.com> wrote:

Hi

I've just started playing with WikklyText and I really like it.

One thing I was hoping to do, but can't seem to: forms.

I was hoping to be able to put a <form> with some controls on one
page, have the action point to another page and on the target page
have a <?py> .. </?py> block get the variables out of the context
object, but it seems they aren't there.

Hi, the current development version has a new feature that may be helpful. In 1.6 you'll be able to attach arbitrary WSGI applications to the wiki via plugins. I added this because I needed the capability for javascript to make AJAX calls back to the wiki and populate <divs> on a page. But it should work just as well for form submission. The idea would be ...

a. Create a plugin named 'foo'
b. 'foo' attaches a WSGI app to the URI "/myTarget"
c. Create a form on some page:
       <form action="/api/plugins/foo/myTarget">
             ...
d. Now your plugin gets the form data just like any WSGI app would.

It is up to you if want to serve a page directly from /myTarget, or do a redirect, etc., I just wanted to illustrate how this works. I'm going to add something like this to the "hello" plugin to demonstrate how it works in a full sample.



The reason I want to do forms is that I thought a served WikklyText
wiki might be a quick way to put a gui on some local python scripts.

I agree! This has been a goal of mine since starting WikklyText -- being able to host applets inside the wiki -- so I'd appreciate any feedback or ideas along these lines.

frank

For more info ...
     http://wikklytext.com/WritingPlugins
     http://wikklytext.com/GettingPlugins
     http://www.python.org/dev/peps/pep-0333/

shalpin

unread,
Oct 1, 2008, 10:09:42 PM10/1/08
to WikklyText
Thanks - that sounds just what I was after ... more even.

I haven't any ideas or feedback at the moment :) I'm just looking for
it to be simple and easy. I think the changes will do this.

Thanks for the quick reply too.

Reply all
Reply to author
Forward
0 new messages