If I have open a Instance Selector Panel pop-up, and then create a new object in there to select, it's fine.
But if while it's open, I open an Instance Selector Panel defined on that object - so being 2 levels deep, kind of thing,
then when I save the original object, it shows a regular admin listing view - so with 'edit' and 'delete' buttons, and no 'select' button.
Pseudo code:
class Category(ClusterableModel):
name = models.CharField(max_length=100)
class Product(ClusterableModel):
name = models.CharField(max_length=100)
panels = [
FieldPanel('name'),
InlinePanel('categories')
]
class ProductCategory(ClusterableModel):
category = ParentalKey(Category, on_delete=models.CASCADE, related_name="products")
product = ParentalKey(Produce, on_delete=models.CASCADE, related_name="categories")
panels = [
InstanceSelectorPanel('category'),
InstanceSelectorPanel('product'),
]
class ShopPage(Page):
...
common_panels = [
InlinePanel("shop_products"),
]
class ShopProduct(ClusterableModel):
product = ParentalKey(Product, on_delete=models.CASCADE)
parent_page = ParentalKey(ShopPage, on_delete=models.CASCADE, related_name="shop_products")
panels = [
InstanceSelectorPanel('product'),
PageSelectorPanel('parent_page'),
]
I've solved currently by switching all of the sub-selectors into a more basic ModelChooserPanel that we're using in other places in the project.
If I have open a Instance Selector Panel pop-up, and then create a new object in there to select, it's fine.
But if while it's open, I open an Instance Selector Panel defined on that object - so being 2 levels deep, kind of thing,
then when I save the original object, it shows a regular admin listing view - so with 'edit' and 'delete' buttons, and no 'select' button.
Pseudo code:
I've solved currently by switching all of the sub-selectors into a more basic
ModelChooserPanelthat we're using in other places in the project.