On Fri, 2006-09-22 at 09:15 +0200, Simon de Haan wrote:
> Malcom,
> 
> 
> In the ticket you mentioned that it can be pretty easily done via a
> view dispatcher - could you elaborate more on this? I'd be interested
> as to how one would go about doing this.

The URL dispatcher doesn't change from what it is like now. It
dispatches to a view function that is responsible for passing off
control for any methods that need specific controllers. For example

        def dispatcher(request, *args, **kwargs):
            func = {
                'POST': post_handler,
                'PUT': put_handler,
            }.get(request.method, default_handler)
            return func(*args, **kwargs)
        
Here, you have already defined functions called post_handler,
put_handler and default_handler. Or you can do without the default
handler and just handle that inside dispatcher. The possibilities are
pretty endless here.

Regards,
Malcolm




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to