I have a django CMS page extension:
show_in_catalog = models.BooleanField()
filters_to_show = models.ManyToManyField(Attribute)
def get_filterset_kwargs(self, filterset_class):
extension = MyAppExtension.objects.get(
attributes = extension.filters_to_show.all()
cms.Page objects exist in published and draft form, and the draft (along with all the objects associated with it) is copied to the other version in the Publish operation.
ManyToManyField attributes. These will need to be copied too, otherwise the published version will fail - as you have discovered - to get back to these objects.
Handling relations in the documentation for Page extensions explains what to do and gives an example - in brief, provide a
copy_relations() method on the Page extension, that copies them to the new instance.
Without this method you'll find that all copy operations on the page, not just publishing, fail to copy the objects.