You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful for some page types to be able to "upgrade" or "replace" themselves with a different page type. For example, replacing a regular page with a redirect, or upgrading a FlatPage to a FluentPage
The text was updated successfully, but these errors were encountered:
Yep. We had this issue a little while back too, when we started out with one page type then during development switched to another more advanced page type. But the different page types will probably have different fields, and it might not be (probably often won't be) the case that you can easily just convert them.
I imagine it will involve a data migration, so perhaps some helper functions provided by django-polymorphic or django-fluent-pages could make it easier to write data migrations, and some docs, would do the trick?
Exactly. The idea is to "tear down / remove" the derived class only, and create a new subclass in it's place + update the polymorphic_ctype field. Next, I think both classes also need a method which they can override, so they can remove any additionally linked models (such as translations, or M2M relations) that would remain stale in the database otherwise. In case of the FluentContentsPage, it could remove the ContentItem objects unless the new page also inherits from FluentContentsPage.
It would be useful for some page types to be able to "upgrade" or "replace" themselves with a different page type. For example, replacing a regular page with a redirect, or upgrading a FlatPage to a FluentPage
The text was updated successfully, but these errors were encountered: