Re: showing future events only?

2006-08-17 Thread Jeremy Dunck
On 8/17/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > urls.py is loaded when Apache (or your server process) starts. Correction, it's loaded when your first request comes in on a new process. ;-) --~--~-~--~~~---~--~~ You received this message because you are

Re: showing future events only?

2006-08-17 Thread Jeremy Dunck
On 8/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > OK, Jeremy, Ian, you've lost me now.. > > Is there something wrong with the code I posted above? It appears to be > working fine. Is there something superior about this: urls.py is loaded when Apache (or your server process) starts.

Re: showing future events only?

2006-08-17 Thread Malcolm Tredinnick
On Thu, 2006-08-17 at 05:14 -0700, [EMAIL PROTECTED] wrote: > OK, Jeremy, Ian, you've lost me now.. > > Is there something wrong with the code I posted above? It appears to be > working fine. Is there something superior about this: > > > > from django.core.models import LazyDate > > ... > >

Re: showing future events only?

2006-08-17 Thread [EMAIL PROTECTED]
OK, Jeremy, Ian, you've lost me now.. Is there something wrong with the code I posted above? It appears to be working fine. Is there something superior about this: > from django.core.models import LazyDate > ... > 'queryset': Show.objects.filter(show_date__gte=LazyDate()), > ...

Re: showing future events only?

2006-08-16 Thread Jeremy Dunck
On 8/16/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > would this actually work? > > I thought this would have been evaluated when you start up the > process, and the show_dict is first called. > not on every request (which is what they want I'm guessing) Ack, you're right. You'll need to defer

Re: showing future events only?

2006-08-16 Thread Ian Holsman
would this actually work? I thought this would have been evaluated when you start up the process, and the show_dict is first called. not on every request (which is what they want I'm guessing) regards Ian. On 17/08/2006, at 5:30 AM, [EMAIL PROTECTED] wrote: > > Do I need to import datetime

Re: showing future events only?

2006-08-16 Thread Jeremy Dunck
On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Do I need to import datetime into urls.py or something? from datetime import datetime datetime.now() should do... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: showing future events only?

2006-08-16 Thread Jeremy Dunck
On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I've got an app for user events, using the generic list view to display > them. So far , so good. But I don't want to display them if the date is > past. So, how would I filter those out. Here's the template code, so > you can sorta see

Re: showing future events only?

2006-08-16 Thread [EMAIL PROTECTED]
Do I need to import datetime into urls.py or something? I'm passing show_dict = { 'queryset': Show.objects.filter(show_date__gte=datetime.now()), 'template_object_name': 'show', 'allow_empty': 'true', } but it throws an error: NameError at /shows/ name 'datetime' is not defined

Re: showing future events only?

2006-08-16 Thread [EMAIL PROTECTED]
I'm using the generic list view. There was some reason I didn't think the generic date view was right for this, although I can't remember what it was now. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: showing future events only?

2006-08-16 Thread Corey Oordt
I thought a change was made in the generic date views to show only future events. It is the allow_future parameter, I believe. Corey On Aug 16, 2006, at 1:38 PM, [EMAIL PROTECTED] wrote: > > I've got an app for user events, using the generic list view to > display > them. So far , so

Re: showing future events only?

2006-08-16 Thread Ian Clelland
On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I've got an app for user events, using the generic list view to display > them. So far , so good. But I don't want to display them if the date is > past. So, how would I filter those out. Here's the template code, so > you can sorta see

Re: showing future events only?

2006-08-16 Thread [EMAIL PROTECTED]
Got it! added import datetime then show_dict = { 'queryset': Show.objects.filter(show_date__gte=datetime.datetime.now()), 'template_object_name': 'show', 'allow_empty': 'true', } Thank you Ian! I knew it had to be something fairly straightforward, but sometimes it's all a matter of

showing future events only?

2006-08-16 Thread [EMAIL PROTECTED]
I've got an app for user events, using the generic list view to display them. So far , so good. But I don't want to display them if the date is past. So, how would I filter those out. Here's the template code, so you can sorta see what I'm getting at: {% for show in