I think you are confusing two things here: querying the DB in views and
displaying the output through templates.

To get your object in a random order, add the order_by('?') to the view, see
(see http://www.djangoproject.com/documentation/models/ordering/)

Then you can just iterate through your (randomly ordered result) with a
template for loop.

HTH

Ludwig


2008/9/3 Cortland Klein <[EMAIL PROTECTED]>

>
> I've got the following in my template:
> > {% for question in event.question_set.order_by('?') %}
>
> And am getting the error "Could not parse the remainder: '('?')'".
>
> I'm trying to randomly iterate through these objects.
>
> Should I implement a custom filter, or is there an easier way to
> accomplish this?
>
> --
> Cortland Klein <[EMAIL PROTECTED]> +1 408 506 9791
> http://pixelcort.com/
> 2260 California Street #13
> Mountain View, CA, USA 94040
>
> Alumni, Business Management <[EMAIL PROTECTED]>
> San José State University
>
> Alumni Technical Advisor, Entrepreneurial Society <[EMAIL PROTECTED]
>  >
> http://e-society.org/
>
> Q&A Techie, Silicon Valley Mac User Group
> http://svmug.org/
>
> Member, Silicon Valley Google Technology User Group
> http://sv-gtug.org/
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to