-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hello, Im getting this error:
My class has a foreign key to self.
class Category(models.Model):
name = models.CharField(("name"), unique=True, max_length=100)
slug = models.SlugField(("slug"))
parent = models.ForeignKey('self', blank=True, null=True, related_name='child')
At some point, it goes into this:
File "…/django-cachebot/cachebot/queryset.py", line 138, in _get_join_paths
for model_class, join_accessor_path in self._get_join_paths(join_tuple[0], join_tuple[2]):
File "…/django-cachebot/cachebot/queryset.py", line 138, in _get_join_paths
for model_class, join_accessor_path in self._get_join_paths(join_tuple[0], join_tuple[2]):
..... again
..... again ....
Then finally:
File ".../django-cachebot/cachebot/queryset.py", line 130, in _get_join_paths
model_class, m2m = self.queryset._get_model_class_from_table(table_alias)
File "....django-cachebot/cachebot/queryset.py", line 184, in _get_model_class_from_table
model_class = [m for m in get_models() if connection.introspection.table_name_converter(m._meta.db_table) in map(connection.introspection.table_name_converter,[table])][0]
RuntimeError: maximum recursion depth exceeded
Any ideas?
Thanks