modlinltd / django-advanced-filters

Add advanced filtering abilities to Django admin
https://pypi.org/project/django-advanced-filters/
MIT License
769 stars 172 forks source link

But in the documntation and solution #183

Open Kifsif opened 1 year ago

Kifsif commented 1 year ago

Describe the bug There is a bug in the documentation. Write: re_path(r'^advanced_filters/', include('advanced_filters.urls')),

rather than:

url(r'^advanced_filters/', include('advanced_filters.urls')),

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Details (please complete the following information):

Additional context $ python manage.py migrate Traceback (most recent call last): File "manage.py", line 22, in main() File "manage.py", line 18, in main execute_from_command_line(sys.argv) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/management/init.py", line 419, in execute_from_command_line utility.execute() File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/management/init.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, cmd_options) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, *options) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/management/base.py", line 89, in wrapped res = handle_func(args, kwargs) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 75, in handle self.check(databases=[database]) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/management/base.py", line 419, in check all_issues = checks.run_checks( File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/checks/registry.py", line 76, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 13, in check_url_config return check_resolver(resolver) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 23, in check_resolver return check_method() File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 412, in check for pattern in self.url_patterns: File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/utils/functional.py", line 48, in get res = instance.dict[self.name] = self.func(instance) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 598, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/utils/functional.py", line 48, in get res = instance.dict[self.name] = self.func(instance) File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 591, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 848, in exec_module File "", line 219, in _call_with_frames_removed File "/home/michael/Documents/PyCharmProjects/marketing3/marketing3/marketing3/urls.py", line 22, in url(r'^advanced_filters/', include('advanced_filters.urls')), File "/home/michael/Documents/PyCharmProjects/marketing3/venv/lib/python3.8/site-packages/django/template/defaulttags.py", line 1369, in url bits = token.split_contents() AttributeError: 'tuple' object has no attribute 'split_contents'