[mod_python] AJAX and Vampire's Publisher

Graham Dumpleton grahamd at dscpl.com.au
Thu Apr 13 06:20:18 EDT 2006


On 11/04/2006, at 3:25 PM, apocalypznow wrote:

> Does anyone have any experience using AJAX (in particular, SAJAX)  
> with Vampire Publisher?  Does it work?

FWIW, on the server side what you write for an AJAX client isn't  
necessarily
going to be that much different to any other sort of web application.  
The only
real difference that has to be considered with AJAX programming is the
potential need to be able to POST varying content types. Some handlers
for mod_python only support a POST content type of multipart/form,  
ie., HTML
form data. Obviously this is a big restriction if you want to POST  
XML data of
some form.

If all you want to POST is HTML form data, then you may as well use the
mod_python.publisher that comes with mod_python itself. Probably best  
just
to ensure you are using mod_python 3.2.8 though as that version resolves
for publisher at least some of the module loading/reloading issues.

If you do want to POST XML data or other types of data, for example  
JSON,
then using mod_python.publisher as the dispatch method for URLs isn't
going to work as it will not allow you to do that. In this case then  
using either
vampire::publisher or vampire.Publisher(), presuming that you were  
referring
specifically to these when you said "Vampire's Publisher", certainly  
may be
a better option because it is more flexible.

But then the publisher like bits of Vampire, like the original  
mod_python.publisher
they emulate, only support GET and POST. If you wanted to use REST ideas
of using GET, POST, PUT and DELETE as appropriate, then you may need
to drop down to the lower level handler style interfaces in Vampire  
as they don't
restrict the method types.

So, although Vampire has shown itself to work in various scenarios,  
it is
probably better to be asking whether it meets the requirements you may
have in respect of the sort of data you may want to POST back to the  
application
and whether supporting them is possible. This goes the same for whatever
additional layers on top of mod_python that you may be looking at. In  
short,
it isn't just what URL mapping mechanism something provides that is
important.

Anyway, hope this stimulates you to think more about the issues as I  
really don't
think it is a simple question as to whether a particular client side  
AJAX toolkit
works with Vampire or not.

I would also hope that you might describe more about what you perceive
mod_python or some layer on top of it needs to provide to facilitate  
AJAX
style clients, as it isn't something that has really been discussed  
on the
mailing list at all, so am curious to hear your (and others) ideas on  
it all.

Graham


More information about the Mod_python mailing list