Need advice on writing very specific custom user roles

2017-09-09 Thread Ahmad Zoughbi
Hello, I need to build custom Django user roles, and i need an advice on the best approach (or library that i can use) to achieve that: 1. There will be 3 different user levels: 1. Author 2. Editor 3. Verification 2.

Re: How to limit ForeignKey field to another model FK depending on value

2016-02-02 Thread Ahmad Zoughbi
Just for reference: i could get it to work by passing limit_choices_to to the "province" in Project model. class Project(models.Model): project_name = models.CharField(max_length=100) province = models.ForeignKey(Province, limit_choices_to={"country": 1}) -- You received this message

Re: How to limit ForeignKey field to another model FK depending on value

2016-02-02 Thread Ahmad Zoughbi
Thanks James. But i think this solution will apply also on both models (WorkArea and Project) right? while i want to get it to work only on the field province of model *Project . * On Tuesday, February 2, 2016 at 12:22:20 AM UTC+2, James Schneider wrote: > > The question: In the model Project h

How to limit ForeignKey field to another model FK depending on value

2016-02-01 Thread Ahmad Zoughbi
I have the following models in Django, and using smart-selects: class Country(models.Model): name = models.CharField(max_length=100) class Province(models.Model): name = models.CharField(max_length=100) country = models.ForeignKey(Country) class City(models.Model): name = model