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
request.user
       ....

To see how queryset behaves by default, look at
django.contrib.admin.options.py

Hope that helps.

On Sep 21, 9:04 am, Alessandro <[EMAIL PROTECTED]> wrote:
> 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_permission(request, obj)
>         elif obj is None:
>             return True
>         else:
>             return False
>
> but I want the admin to show only the user objects in the object list.
> is it possible?
>
> thanks in advance.
> --
> Alessandro Ronchi
> Skype: aronchihttp://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
-~----------~----~----~----~------~----~------~--~---

Reply via email to