Inlines user permissions problem + view only permissions

2010-05-18 Thread Vali Lungu
Hello,

I'm not sure if this is a bug or I'm just missing something (although I have
already parsed the documentation about inlines), but:

Let's say I have a model A. Model A is an inline of model B. User U has full
access to model B, but only change permissions to model A (so, no add, nor
delete).

However, when editing model B, user U can still see the "Add another A" link
at the bottom, although U hasn't add permissions for that respective model.

What's wrong? Why does that link keep on showing? My logic says that if U
does not have permissions to add A, the link shouldn't appear anymore.

Also, ideally, I would like to give U only view rights to model A (so no
add, delete or change - only view), but I've read about that (strange, if
you ask me) philosophy according to which "If you don't trust U, just deny
him access to the admin area all together". Kind of a stupid doctrine.

Right now, I'm trying to simulate this 'view only permissions' by leaving U
with just change rights and set all fields as read only. But I think this is
kind of a stupid approach and may also cause problems like the permissions
thing above...

How does an average Django programmer like me achieve view-only permissions,
and most of all how should I get rid of the "Add another A" link at the
bottom of the admin edit form?

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Best OS - VPS environment

2010-08-16 Thread Vali Lungu
My development environment includes Ubuntu 9.10 and 10.04. I'm also using
virtualenvs, but not w/ Apache. I'm using Nginx instead.
This configuration has been working flawlessly for me, and I'm implementing
it on all production servers too. It's quite fast and flexible, and quite
easy to install.

See http://djangoadvent.com/1.2/deploying-django-site-using-fastcgi/ for
more info. However, please note that the instructions concerning daemontools
are completely screwed up in this article (it's actually much simpler to set
it up).

On Mon, Aug 16, 2010 at 10:54 AM, Dan  wrote:

> I have been using CentOS 5 to run Django sites with Apache + Mod WSGI
> mostly in VPS environments.
>
> I want to upgrade to a new OS as CentOS runs an old version of python
> and it seems that it's not so easy to upgrade it.
>
> What do people recommend?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: reverse ForeignKey

2010-09-23 Thread Vali Lungu
Hi,

You may be interested in this:
http://stackoverflow.com/questions/2618893/how-to-filter-queryset-in-changelist-view-in-django-admin,
looks like a similar (solved) problem.
In short, it's about overriding the queryset() method of ModelAdmin.

On Thu, Sep 23, 2010 at 11:33 AM, ionut cristian cucu
wrote:

> Hi list,
> I just came to django, and to web programming for that matter, so my
> question is from a n0b:
> I have to models:
> class Pacient(models.Model):
> name=models.CharField('name', max_length=123)
> 
> class Exit(models.Model):
>  pacient=models.ForeignKey(Pacient)
> 
>
> How to I get the admin interface to show only the pacients for whom I
> have no exit objects.
> Rephrase: if I have an Exit object for a Pacient, I don't want that
> Pacient object to show up
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.