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 queryset(self, request):
qs = super(SchedaOptions,self).queryset(request)
utente = request.user
if utente.is_superuser:
return qs
else:
return qs.filter(referente=utente)
maybe it can be useful to add a line on django book, it's a common need.
--
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net
SOASI Soc.Coop. - www.soasi.com
Sviluppo Software e Sistemi Open Source
Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
Tel.: +39 0543 798985 - Fax: +39 0543 579928
Rispetta l'ambiente: se non ti è necessario, non stampare questa mail
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---