Doesn't Seem to Work With Django 1.9 / Python3

Issue #2 wontfix
Peter Novotnak
created an issue

Here's an example traceback;

Traceback (most recent call last):
  File "~/myproject/env/lib/python3.5/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "~/myproject/env/lib/python3.5/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "~/myproject/env/lib/python3.5/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "~/myproject/env/lib/python3.5/site-packages/rest_framework/viewsets.py", line 87, in view
    return self.dispatch(request, *args, **kwargs)
  File "~/myproject/env/lib/python3.5/site-packages/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "~/myproject/env/lib/python3.5/site-packages/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "~/myproject/env/lib/python3.5/site-packages/rest_framework/mixins.py", line 56, in retrieve
    instance = self.get_object()
  File "~/myproject/env/lib/python3.5/site-packages/rest_framework/generics.py", line 97, in get_object
    obj = get_object_or_404(queryset, **filter_kwargs)
  File "~/myproject/env/lib/python3.5/site-packages/rest_framework/generics.py", line 20, in get_object_or_404
    return _get_object_or_404(queryset, *filter_args, **filter_kwargs)
  File "~/myproject/env/lib/python3.5/site-packages/django/shortcuts.py", line 155, in get_object_or_404
    return queryset.get(*args, **kwargs)
  File "~/myproject/env/lib/python3.5/site-packages/django/db/models/query.py", line 381, in get
    num = len(clone)
  File "~/myproject/env/lib/python3.5/site-packages/django/db/models/query.py", line 240, in __len__
    self._fetch_all()
  File "~/myproject/env/lib/python3.5/site-packages/django/db/models/query.py", line 1074, in _fetch_all
    self._result_cache = list(self.iterator())
  File "~/myproject/env/lib/python3.5/site-packages/django/db/models/query.py", line 69, in __iter__
    obj = model_cls.from_db(db, init_list, row[model_fields_start:model_fields_end])
  File "~/myproject/env/lib/python3.5/site-packages/django/db/models/base.py", line 460, in from_db
    new = cls(*values)
  File "~/myproject/env/lib/python3.5/site-packages/django/db/models/base.py", line 363, in __init__
    self._state = ModelState()
  File "~/myproject/env/lib/python3.5/site-packages/immutablefield/models.py", line 53, in __setattr__
    meta = self._immutable_meta
AttributeError: 'Product' object has no attribute '_immutable_meta'

Comments (4)

  1. Peter Novotnak reporter

    Sorry to bother you, yeah I figured that out very quickly after posting my issue.

    Would you remove the package from PyPi? It comes up first on google when searching "django immutable fields" and is a little bit of a time-waster when there are forks that are relatively actively maintained.

  2. Log in to comment