TypeError at /admin/library/mymodel/
__call__() missing 1 required keyword-only argument: 'manager'
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/library/mymodel/
Django Version: 4.1.2
Exception Type: TypeError
Exception Value:
__call__() missing 1 required keyword-only argument: 'manager'
Exception Location: /home/ioann/.local/share/virtualenvs/Django_Libraries-js9DAKL4/lib/python3.8/site-packages/django/contrib/admin/utils.py, line 284, in lookup_field
Raised during: django.contrib.admin.options.changelist_view
Python Executable: /home/ioann/.local/share/virtualenvs/Django_Libraries-js9DAKL4/bin/python
Python Version: 3.8.10
Python Path:
['/home/ioann/pythonProject/pythonProject/Django_Libraries/lib_one',
'/usr/lib/python38.zip',
'/usr/lib/python3.8',
'/usr/lib/python3.8/lib-dynload',
'/home/ioann/.local/share/virtualenvs/Django_Libraries-js9DAKL4/lib/python3.8/site-packages']
Server time: Sun, 09 Oct 2022 12:05:04 +0000
Error during template rendering
In template /home/ioann/.local/share/virtualenvs/Django_Libraries-js9DAKL4/lib/python3.8/site-packages/django/contrib/admin/templates/admin/change_list.html, error at line 68
__call__() missing 1 required keyword-only argument: 'manager'
58 {% block search %}{% search_form cl %}{% endblock %}
59 {% block date_hierarchy %}{% if cl.date_hierarchy %}{% date_hierarchy cl %}{% endif %}{% endblock %}
60
61 <form id="changelist-form" method="post"{% if cl.formset and cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %}
62 {% if cl.formset %}
63 <div>{{ cl.formset.management_form }}</div>
64 {% endif %}
65
66 {% block result_list %}
67 {% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %}
68 {% result_list cl %}
69 {% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %}
70 {% endblock %}
71 {% block pagination %}{% pagination cl %}{% endblock %}
72 </form>
73 </div>
74 {% block filters %}
75 {% if cl.has_filters %}
76 <div id="changelist-filter">
77 <h2>{% translate 'Filter' %}</h2>
78 {% if cl.has_active_filters %}<h3 id="changelist-filter-clear">
class Topic(models.Model):
name = models.CharField(max_length=200)
category = models.ForeignKey(
Category, verbose_name="Category", on_delete=models.SET_NULL, null=True, related_name='topic'
)
content = models.TextField()
likes = models.ManyToManyField(User, related_name='topic_likes', default=None, blank=True)
created = models.DateTimeField(auto_now_add=True)
tags = TaggableManager()
slug = models.SlugField(max_length=130, unique=True, default=uuid.uuid1)
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='author_set')
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='topic_bookmark')
views = models.ManyToManyField(Ip, related_name="post_views", blank=True)
count_user = models.ManyToManyField(User, through="CountUser")
objects = models.Manager()
def user_count(self):
return self.count_user.count()
class CountUser(models.Model):
topic = models.ForeignKey(Topic, on_delete=models.CASCADE, related_name='count_topic_user')
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='count_user_user')
class Meta:
unique_together = [('user', 'topic')]