Re: Accessing session in Django models?

2016-08-03 Thread Constantine Covtushenko
Hi Neto, As said in Documentation of 'limit_choices_to' value for this key should be: `Either a dictionary, a Q object, or a callable returning a dictionary or Q object can be used.` For your

Accessing session in Django models?

2016-08-03 Thread Neto
I have a field with *limit_choices_to*, and want it to be only filtered items related the account ('ID') user. How can I do this? Example (Does not work): class Car(models.Model): user = models.ForeignKey(User) color = models.CharField(max_length=200) typeo =