Thanks Daniel, makes sense. Also, I was making the mistake of thinking that
I had to create a separate view, forgetting that I am calling the one
supplied by django-voting. That correct?



On Mon, Nov 1, 2010 at 3:45 PM, Daniel Roseman <dan...@roseman.org.uk>wrote:

> On Nov 1, 1:23 pm, Sithembewena Lloyd Dube <zebr...@gmail.com> wrote:
> > Hi all,
> >
> > I have django-voting installed and am trying to get through the 'recipe'.
>  I
> > have a url pattern which (I expect) should route voting actions to a
> view.
> >
> > Problem is, which view or views should handle this? The URL pattern is as
> > follows:
> >
> >
>  (r'^videos/(?P<object_id>\d+)/(?P<direction>*up|down|clear)*vote/?$',
> > vote_on_object, video_dict),
> >
> > I can see that object_id is being trapped as a parameter, but what is the
> > italicised/ bold section doing and what URL do I then get out of it? In
> > other words, I cannot decide what the view/s to handle the URL should be.
> >
> > Thanks,
> >
> > --
> > Regards,
> > Sithembewena Lloyd Dubehttp://www.lloyddube.com
>
> That constrains the acceptable values of `direction` to one of 'up',
> 'down' or 'clear'. Any other value there will mean the URL isn't
> matched.
>
> So the URL is, for example:
> /videos/1/upvote/
> /videos/1/downvote/
> /videos/1/clearvote/
>
> and the view will have parameters of object_id 1 and direction up,
> down or clear.
> --
> DR.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to