Reputation: 231
I want to customize the Wagtail editing interface as defined in the docs:
The problem is that my form has a field with a queryset that gets objects from the model, so I keep running into circular dependencies.
How can I define a base_form_class
that is loaded after the model? Any way around this?
Upvotes: 3
Views: 324
Reputation: 231
Figured it out! The simple and obvious solution is to define model attribute outside of the class.
class EventPage(Page):
...
# Instead of:
# base_form_class = EventPageForm
class EventPageForm(WagtailAdminPageForm):
...
EventPage.base_form_class = EventPageForm
Upvotes: 2