I have two models in Django 1.8.8:
class Company(models.Model):
name = models.CharField(max_length=200)
members = models.ManyToManyField(User)
class Folder(models.Model):
name = models.CharField(max_length=200)
slug = models.SlugField(null=True, blank=True)
company = models.ForeignKey(Company, null=True, blank=True)
parent = models.ForeignKey("Folder", null=True, blank=True)
and when I'm doing in template
{% for user in current_folder.company.members.all %}
I sometimes (randomly after a few page's reload) get very strange error:
FieldDoesNotExist: Company_members has no field named None
I also use sqlite3 database. Anyone have idea where is a problem?
{% for user in current_folder.company.members.all %} {% if user %} ....
– Eeriemanage.py test
tool in tandem with Flask. – Bore