I have expanded the Django admin site for my application to allow access not to employees / superusers. This works great.
I created a proxy model for an existing model and registered it on my admin site, however it is not displayed for non-employee users. From the documentation I read, I understand that proxy models get their own permissions. I checked and they do not appear in the list of available permissions.
Here is my code in case this helps:
Normal model
class Engagement(models.Model): eng_type = models.CharField(max_length=5) environment = models.CharField(max_length=8) is_scoped = models.BooleanField() class Meta: ordering = ['eng_type', 'environment'] app_label = 'myapp'
Proxy model
class NewRequests(Engagement): class Meta: proxy = True app_label = 'myapp' verbose_name = 'New Request' verbose_name_plural = 'New Requests'
Admin Model
class NewRequestsAdmin(ModelAdmin): pass def queryset(self, request): return self.model.objects.filter(is_scoped=0)
Administrator User Registration
myapps_admin_site.register(NewRequests, NewRequestsAdmin)
I manage my database with the South. According to this post , you need to fake it a bit by following the instructions that it tells users to . It was a failure. My database does not contain much information, so I dug up the South and conducted a regular synchronizer to exclude the South. Unfortunately, this still does not work, and I am at a loss. Any help is appreciated.
Edit
It was on Django 1.4
chirinosky
source share