Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FieldDoesNotExist: ManyToManyField has no field named None

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?

like image 630
citos88 Avatar asked Mar 15 '16 09:03

citos88


1 Answers

This is most probbly the related django ticket you should check https://code.djangoproject.com/ticket/24513

And this issue could be somehow related though not 100% https://github.com/jet-admin/jet-django/issues/7

You might get some insight reading the threads.

like image 153
auvipy Avatar answered Nov 16 '22 14:11

auvipy