It's easy, if you don't insist on making it part of the admin, to do this
with a custom view.  It can pay attention to whatever permissions you like.


On Wed, Oct 9, 2013 at 10:06 AM, Victor <[email protected]> wrote:

> Yes, I know but unfortunately if in Admin Site you say that a user cannot
> Add, Delete, and Modify a model if that user is connected he/she doesn't
> see the model itself in the list but only those models for which it has
> some kind of permission. I instead would like to make the model visible but
> not editable for that user.
>
> Ciao
> Vittorio
>
> Il giorno 09/ott/2013, alle ore 14:14, Rafael E. Ferrero ha scritto:
>
> > In Admin Site, you can manage users permissions for Add, Delete, Modify
> of every model on your site.
> >
> >
> > 2013/10/9 Vittorio <[email protected]>
> > For the sake of simplicity let's suppose I have
> >
> > models.py
> >
> > class Book(models.Model):
> >     title = models.CharField(max_length=100)
> >     authors = models.ManyToManyField(Author)
> >     publisher = models.ForeignKey(Publisher)
> >
> > Under admin I would like that some username (say "vic" and  "lucky") can
> edit every field of the change form while other users ("tom","sue") can
> only visualize the same data without modification.  I think to put some "if
> condition" in admin.py of this kind
> >
> >
> > class BookOption(admin.ModelAdmin):
> >    if username  in ["tom", "sue"]:
> >                 readonly_fields = ['title','authors','publisher']
> >     fields=(('title'),('authors', 'publisher'))..
> >     .....
> >    admin.site.register(Book,BookOption)
> >
> >
> > How can I do it?
> >
> > Ciao
> > Vittorio
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> > To post to this group, send email to [email protected].
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/F0A087D2-8E11-4B0B-8D95-6FC131854994%40de-martino.it
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
> >
> > --
> > Rafael E. Ferrero
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> > To post to this group, send email to [email protected].
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJJc_8U3EbZXHVSucFndA25V%3DuYyen%3DGgUsyHmzLncD5DuGi2w%40mail.gmail.com
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/B4D514E2-7FA0-4CB3-A83E-82442A8DAFC6%40gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0sAgp3NPgROdd4-ZuarKNGSe723Pon3aZA%2Bm1TqzGx5eg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to