Django — Has no attribute ‘get_formset’

Chances are, you accidentally subclassed admin.ModelAdmin for a class passed as an inline.

Inlines should subclass the inline admin classes: TabularInline or StackedInline

5 Comments

  1. Brett says:

    Hah, awesome! Quick fix. Nice post, perfect answer. Had your answer not been in the top of the Google search results, I may have spent hours looking for this.

  2. ryanom says:

    Thanks for the tip. Like Brett, this saved me a lot of time

    1. Yuji says:

      Glad to hear it helped! I never know if people are reading these things. I post them and run into them myself… haha. I like where Django is going with 1.8+ – lots of validation support. They should add common mistakes like this. But it’s a tough call how to implement (code bloat), whether to use type checks or allow duck type but show suggestions on errors. Real interesting stuff.

      Wonder how hard it is to lint django specific patterns?

      Anyways, enjoy.

  3. Anonymouse says:

    Spot On!!

  4. robray says:

    Nailed it. Thanks!

Leave a reply to Yuji Cancel reply