You can generate a random number for the year, random number for the day,
and query with them.

Regards,
Sherif.

On Thu, Jan 5, 2012 at 10:14 PM, Tim Sawyer <list.dja...@calidris.co.uk>wrote:

> Hi Folks,
>
> Does anyone have a strategy for selecting from a database where the date
> is this week, but a random year in the past?
>
> I have ~100 years of events in a database, each with a datefield - I would
> like to do a "this week in history" box that lists one or two on the
> homepage, randomly taken from the set.
>
> Ideas/pointers appreciated.
>
> Cheers,
>
> Tim.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com <django-users%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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