Re: User related objects

2014-07-02 Thread Lachlan Musicman
This is what you are after: https://docs.djangoproject.com/en/1.6/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_model cheers L. On 2 July 2014 21:42, Jonathan Querubina wrote: > My problem is doing this on django-admin. > > Thanks! > > On Jul 2, 2014, at 8:31 AM, Lachlan Musicman wro

Re: User related objects

2014-07-02 Thread Jonathan Querubina
My problem is doing this on django-admin. Thanks! On Jul 2, 2014, at 8:31 AM, Lachlan Musicman wrote: > There are a couple of ways to do it, filtered queries are the obvious solution > > https://docs.djangoproject.com/en/1.6/topics/db/queries/#retrieving-specific-objects-with-filters > > But

Re: User related objects

2014-07-02 Thread Jonathan Querubina
Is there a way to set the ForeignKey(User) or ForeignKey(PermissionGroup) automatically by the logged user? On Jul 2, 2014, at 8:31 AM, Lachlan Musicman wrote: > There are a couple of ways to do it, filtered queries are the obvious solution > > https://docs.djangoproject.com/en/1.6/topics/db/q

Re: User related objects

2014-07-02 Thread Lachlan Musicman
There are a couple of ways to do it, filtered queries are the obvious solution https://docs.djangoproject.com/en/1.6/topics/db/queries/#retrieving-specific-objects-with-filters But it would require that your model have either a group or owner permission set. (eg class MyModel(models.Model): p

User related objects

2014-07-02 Thread Jonathan Querubina
Hi guys, I need to customize my admin to show only the data related to the user who inserted. Example: When a user log in, the admin shows only the posts inserted by this user. AFAIK, django only set permissions my model, not by objects. Is there a way (or a pip package) to implement this?