List of Users online

2010-05-19 Thread EmileZola
I want to list the logged in users on my index page and was wondering what was the right way to do this. Can I do it similar to this ? def index(request): return render_to_response('index.html', { 'online_users': User.objects.filter(last_login > delay) }) delay being "now - 15 min

Re: View using 2 models

2009-11-12 Thread EmileZola
Well, I missed the point apparently. I was unaware django created reverse attribute for ForeignKey. Thanks ! On Nov 12, 5:44 am, bruno desthuilliers wrote: > On 12 nov, 07:07, EmileZola wrote: > > > > > Alright, I'm pretty new to Django and I've got this problem I ca

View using 2 models

2009-11-12 Thread EmileZola
Alright, I'm pretty new to Django and I've got this problem I can't quite solve. I basically have two models, wich I use to put blog articles into categories. One is a Category and the other is a Subject. So in my categories I might have ('Programming', 'Music', 'Essays') and my subjects are liste