question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatible with Django 1.10

See original GitHub issue

Build is failing for latest Django version. Also when I update one of my projects to Django 1.10 I get the following error when using get_extra_form_kwargs.

Traceback:

File "/project/env/base/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
  39.             response = get_response(request)

File "/project/env/base/lib/python3.5/site-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)

File "/project/env/base/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/project/env/base/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/project/env/base/lib/python3.5/site-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/project/env/base/lib/python3.5/site-packages/django/contrib/auth/mixins.py" in dispatch
  56.         return super(LoginRequiredMixin, self).dispatch(request, *args, **kwargs)

File "/project/env/base/lib/python3.5/site-packages/django/views/generic/base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "/project/env/base/lib/python3.5/site-packages/extra_views/advanced.py" in get
  147.         return super(BaseUpdateWithInlinesView, self).get(request, *args, **kwargs)

File "/project/env/base/lib/python3.5/site-packages/extra_views/advanced.py" in get
  85.         inlines = self.construct_inlines()

File "/project/env/base/lib/python3.5/site-packages/extra_views/advanced.py" in construct_inlines
  69.             inline_formset = inline_instance.construct_formset()

File "/project/env/base/lib/python3.5/site-packages/extra_views/advanced.py" in construct_formset
  28.         formset = super(InlineFormSet, self).construct_formset()

File "/project/env/base/lib/python3.5/site-packages/extra_views/formsets.py" in construct_formset
  39.         return formset_class(**self.get_formset_kwargs())

File "/project/env/base/lib/python3.5/site-packages/django/forms/models.py" in __init__
  880.         if self.form._meta.fields and self.fk.name not in self.form._meta.fields:

Exception Type: AttributeError at /reizen/416/
Exception Value: 'function' object has no attribute '_meta'

InlineModelFormSet that causes the problem (having no problems after removing get_extra_form_kwargs):

class RelatedInline(InlineModelFormSet):
    model = models.TripRelated
    form_class = forms.TripRelatedInlineForm
    max_num = extra = 3
    fk_name = 'trip'

    def get_formset_kwargs(self):
        kwargs = super().get_formset_kwargs()
        kwargs['queryset'] = \
            models.TripRelated.objects.select_related('related')
        return kwargs

    def get_extra_form_kwargs(self):
        kwargs = super().get_extra_form_kwargs()
        kwargs['parent'] = self.object
        return kwargs

This line seems to be the problem as it is trying to get ._meta from the curried function https://github.com/AndrewIngram/django-extra-views/blob/master/extra_views/formsets.py#L37 .

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
000paradox000commented, Nov 10, 2016

This worked for me # formset_class.form = staticmethod(curry(formset_class.form, *_extra_form_kwargs)) formset_class.form = wraps(formset_class.form)(partial(formset_class.form, *_extra_form_kwargs))

0reactions
auvipycommented, Aug 29, 2018

this can be closed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incompatible with Django 1.10 due to option_list being ...
In Django 1.8 option_list was depracted in favour of implementing add_arguments , and as such with Django's deprecation policy, the former way was...
Read more >
Django 1.10 release notes
Welcome to Django 1.10! These release notes cover the new features, as well as some backwards incompatible changes you'll want to be aware ......
Read more >
How to integrate django-admin-bootstrapped with django 1.10
I've also had the same problem since migrating to django 1.10. Waiting for newer version of django-admin-bootstrapped may take time.
Read more >
Change log — Django Debug Toolbar 3.8.1 documentation
Add check W006 to warn that the toolbar is incompatible with TEMPLATES ... This version is compatible with Django 1.10 and requires Django...
Read more >
Issue #2741: Pulp is not compatible with Django 1.10 - Planio
Django 1.10 is coming with Fedora 26 so we should fix this before that release. Also, Django 1.11 is coming with Rawhide (F27)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found