FrankWiles.com

Wagtail InlinePanel TypeError

I’ve been using Wagtail for awhile now. For this site, at REVSYS, and with clients. Yesterday I did a few small updates to this site and went to add in a few more quotes I found recently to the homepage.

Honestly, I was going to procrastinate it because I’ve been having a crappy week but I managed to click over to add them in before I forgot. However just as I went to add the page I get hit with the dreaded:

IMAGE

And it wasn’t immediately apparent if this was a problem with some of the upgrades I had done yesterday or if there was something else going on. It was actually, but the answer was kinda hard to find.

After quite a bit of Googling around and false starts, I came across this Wagtail mailing list message. Turns out the syntax for InlinePanels was deprecated in Wagtail 1.0 and dropped completely in 1.2. So my recent move from 1.0 straight to 1.3.1 was the culprit. All that was necessary was to change all InlinePanel instances to not pass in the Model. So from this:

InlinePanel(QuotePage, 'authors', label='Authors')

to this:

InlinePanel('authors', label='Authors')

Hopefully this post helps others find the answer more quickly, but honestly, I’m writing this here so when I go to upgrade another Wagtail site in a few weeks I will be able to find it! hahaha

Posted 01 March 2016

Headshot of Frank Wiles

Frank Wiles

Founder and President of REVSYS and current President of the Django Software Foundation. Web/Ops maven specializing in scaling complex web applications. Want to reach out? Contact me here or use the social links below.