lightweightdjango / examples

Code examples for "Lightweight Django", by Julia Elman and Mark Lavin.
http://bit.ly/lightweightdjango
441 stars 221 forks source link

Issue with Chapter 4 source. #17

Closed sakii007 closed 8 years ago

sakii007 commented 8 years ago

I got this exception when i use exact code of Chapter 4:

Meta.fields contains a field that isn't defined on this FilterSet

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x0000000003F05D90>
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "C:\Python34\lib\site-packages\django\core\management\commands\runserver.py", line 116, in inner_run
    self.check(display_num_errors=True)
  File "C:\Python34\lib\site-packages\django\core\management\base.py", line 426, in check
    include_deployment_checks=include_deployment_checks,
  File "C:\Python34\lib\site-packages\django\core\checks\registry.py", line 75, in run_checks
    new_errors = check(app_configs=app_configs)
  File "C:\Python34\lib\site-packages\django\core\checks\urls.py", line 10, in check_url_config
    return check_resolver(resolver)
  File "C:\Python34\lib\site-packages\django\core\checks\urls.py", line 19, in check_resolver
    for pattern in resolver.url_patterns:
  File "C:\Python34\lib\site-packages\django\utils\functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Python34\lib\site-packages\django\core\urlresolvers.py", line 417, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "C:\Python34\lib\site-packages\django\utils\functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Python34\lib\site-packages\django\core\urlresolvers.py", line 410, in urlconf_module
    return import_module(self.urlconf_name)
  File "C:\Python34\lib\importlib\__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "C:\Users\Saket\PycharmProjects\api34\api34\urls.py", line 20, in <module>
    from board.urls import router
  File "C:\Users\Saket\PycharmProjects\api34\board\urls.py", line 3, in <module>
    from . import views
  File "C:\Users\Saket\PycharmProjects\api34\board\views.py", line 5, in <module>
    from .forms import SprintFilter, TaskFilter
  File "C:\Users\Saket\PycharmProjects\api34\board\forms.py", line 29, in <module>
    class TaskFilter(django_filters.FilterSet):
  File "C:\Python34\lib\site-packages\django_filters\filterset.py", line 182, in __new__
    raise TypeError("Meta.fields contains a field that isn't defined "
TypeError: Meta.fields contains a field that isn't defined on this FilterSet

when i remove assigned from this line- fields = ('sprint', 'status', 'assigned', 'backlog', )

server run the project, Sprint & Users urls works fine and task url show me error. So there must be something wrong with this assigned keyword in that particular Line of code.

Help me with this error. Thanx in Advance

mlavin commented 8 years ago

I can't reproduce this with the dependencies listed in the chapter (Python 3,.4, Django 1.8.3, django-filter 0.10, djangorestframework 3.1.3). What made you think removing assigned would address this error? Does your Task model have the assigned column or could there be a typo?

sakii007 commented 8 years ago

i update question, probably it will make my question more clear

mlavin commented 8 years ago

No there is nothing in the update which answers any of the questions that I have.