Re: filter queryset in admin

2008-09-22 Thread Alessandro Ronchi
2008/9/22 Martin Ostrovsky <[EMAIL PROTECTED]>: > > Assuming you're using Django v1.0 ... you could override the queryset > method in your class that defines the admin properties for your class. > For example: Thanks. The solution (tested) is to add this function to the admin class: def quer

Re: filter queryset in admin

2008-09-21 Thread Martin Ostrovsky
Assuming you're using Django v1.0 ... you could override the queryset method in your class that defines the admin properties for your class. For example: class MyAdminClass(admin.ModelAdmin): def queryset(self, request): # Limit the queryset to some subset based on the value of reque

filter queryset in admin

2008-09-21 Thread Alessandro
I want staff users to be able to see and edit only their objects. With newforms admin I managed to avoid cross user editings with def has_change_permission(self, request, obj=None): if obj and request.user == obj.referente: return super(SchedaOptions, self).has_change_permi