Hello,
I have a model called Style that contains a DateField. It stores the
date when the record was created. I want my template to only show
Style records that were created less than 20 days ago. I think that
this needs to be done within the view, but not sure if there is a
filter that I can use in the template. Here is my model:
//////////////
models.py
class Style(models.Model):
newstyles = models.DateField(auto_now_add=True)
//////////////////////
views.py
def newarrivals(request):
s = Style.objects.filter(===Not sure what to do here===)
return render_to_response('newarrivals.htm', {'main': s})
///////////////////
Thanks for any help
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---