[Answered ]-Django executing backward relation query occurred a maximum recursion depth exceeded error when I use Manager

2👍

See this answer: https://stackoverflow.com/a/18208725/1085511

Basically you can not use

super(self.__class__, self)

Use

super(CarSourceManager, self)

instead.

The related manager’s self.__class__ is different from CarSourceManager therefore the loop.

0👍

This is exactly why you have to name the class explicitly when you call super:

return super(CarSourceManager, self).get_query_set().filter(status='S')

Leave a comment