Invalid attributes: filter_order_by,filter_fields... and note on typos/mix up on django_filter(s)
Hi, just a quick note on django-filter/filters before i go into the real issue i'm trying the tutorial in http://docs.graphene-python.org/projects/django/en/latest/tutorial.html and i found some discrepancy between naming django-filter, django-filters at first, mostly because in the django-filter docs here https://django-filter.readthedocs.io/en/latest/install.html
Install with pip:
pip install django-filter
And then add 'django_filters' to your INSTALLED_APPS.
after i made sure i had installed django-filter, not filters, and INSTALLED_APPS entry is also django-filter, i found error in python2.7/site-package/graphene-django/filter/filterset.py line 7-8
from django_filters.filterset import FilterSet, FilterSetMetaclass
from django_filters.filterset import FILTER_FOR_DBFIELD_DEFAULTS
And now i got an error from graphene:
(graphql) o:graphql dev_user$ python manage.py check
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/commands/check.py", line 68, in handle
fail_level=getattr(checks, options['fail_level']),
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/checks/urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/urls/resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/dev_user/dev/projects/graphql/cookbook/urls.py", line 20, in <module>
from . import schema
File "/Users/dev_user/dev/projects/graphql/cookbook/schema.py", line 4, in <module>
import ingredients.schema
File "/Users/dev_user/dev/projects/graphql/ingredients/schema.py", line 4, in <module>
from graphene_django.filter.fields import DjangoFilterConnectionField
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/graphene_django/filter/fields.py", line 4, in <module>
from .utils import get_filtering_args_from_filterset, get_filterset_class
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/graphene_django/filter/utils.py", line 5, in <module>
from .filterset import custom_filterset_factory, setup_filterset
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/graphene_django/filter/filterset.py", line 7, in <module>
from django_filters import Filter, MultipleChoiceFilter
ImportError: No module named django_filters
(graphql) o:graphql dev_user$ python manage.py check
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/commands/check.py", line 68, in handle
fail_level=getattr(checks, options['fail_level']),
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/management/base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/core/checks/urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/urls/resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/dev_user/dev/projects/graphql/cookbook/urls.py", line 20, in <module>
from . import schema
File "/Users/dev_user/dev/projects/graphql/cookbook/schema.py", line 4, in <module>
import ingredients.schema
File "/Users/dev_user/dev/projects/graphql/ingredients/schema.py", line 11, in <module>
class CategoryNode(DjangoObjectType):
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/graphene_django/types.py", line 69, in __new__
**defaults
File "/Users/dev_user/dev/.env/graphql/lib/python2.7/site-packages/graphene/types/options.py", line 31, in __init__
','.join(meta_attrs.keys())
TypeError: Invalid attributes: filter_order_by,filter_fields
First traceback call was from filterset.py, but the 2nd one seems to be an error catched by graphene.
attached is my pip freeze requirements requirements.txt