This list is for the discussion of django itself, this question would be perfect for django-users.
- Jacob On Saturday, 23 February 2013 at 11:50 AM, Delcio Torres wrote: > Dear Sirs, > > Maybe this is a concept question, but here we go. > > I'm doing test development to learn django and using admin for everything. > > This is a Company/Employee/HeathInsurance CRUD system. > > The main ideia is that I want to provide this for different companies and > still not allow them to see each others registers. > > A Django Admin user , should belong to Company or be associated with it > somehow and only see the registers created by other members of the same > company. > > My question is Django Admin Groups from Auth Model would do the task or not. > > I've thought about overriding save_mode and get the group to which the user > belongs , then save it into some group field at HeathInsurance and Employee. > > Then on admin.py thought about overriding the queryset and use a filter so > you would only see registers from your company. > > Is this feasible ? Is this the way? > > Thanks everyone! > > Best Regards, > > Delcio > > Here some model example > ## models.py ## > class Company(models.Model): > name = models.CharField(max_length=200, null=False) > > > class HeathInsurance(models.Model): > nome = models.CharField(max_length=200, null=False) > > > class Employee(models.Model): > name = models.CharField(max_length=200, null=False) > company = models.ForeignKey(Company) > health_insurance = models.ForeignKey(HeathInsurance) > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > (mailto:[email protected]). > To post to this group, send email to [email protected] > (mailto:[email protected]). > Visit this group at http://groups.google.com/group/django-developers?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "Django developers" 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-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
