Bobby Roberts wrote:
>> Is your problem the mechanics of *making* the random choice, or are you
>> uncertain how to get it into your output?
>>
>
> Hi Steve -
>
> Yeah i know the randomization needs to be in the view and then pushed
> back to the template. How would I call the view on each p
Am 08.10.2008 um 10:33 schrieb David Reynolds:
> On 8 Oct 2008, at 4:05 am, Bobby Roberts wrote:
>
>> Yeah i know the randomization needs to be in the view and then pushed
>> back to the template. How would I call the view on each page in the
>> website?
>
>
> Use a template tag.
>
> Oh and Quo
On 8 Oct 2008, at 4:05 am, Bobby Roberts wrote:
> Yeah i know the randomization needs to be in the view and then pushed
> back to the template. How would I call the view on each page in the
> website?
Use a template tag.
Oh and Quote.objects.order_by('?')[0] is probably what you want
--
Da
Bobby Roberts wrote:
> Hi. I have a project with one template only. I am trying to get a
> random quote from the database pushed up to the template so that a new
> quote is shown with each new page url or each page refresh. Can
> someone point out in the docs where this is covered or help me
>
> Is your problem the mechanics of *making* the random choice, or are you
> uncertain how to get it into your output?
Hi Steve -
Yeah i know the randomization needs to be in the view and then pushed
back to the template. How would I call the view on each page in the
website?
thanks in advance
Hi. I have a project with one template only. I am trying to get a
random quote from the database pushed up to the template so that a new
quote is shown with each new page url or each page refresh. Can
someone point out in the docs where this is covered or help me
understand the urls.py structur
6 matches
Mail list logo