[Answered ]-ForeignKey model has no Manager (i.e., 'Foo' object has no attribute 'foo_set')

2👍

The name that Django uses for a reverse foreign key manager is the name of the model that contains the foreign key, not the name of the model that the manager is on.

In your case, it will be:

newboard.hexes_set.create(col=c,row=r)

I find it useful to use the manage.py shell command to import your models and inspect them (with dir, etc) to check out all the available attributes.

👤Wogan

Leave a comment