Skip to content

Conversation

@Anushreebasics
Copy link

@Anushreebasics Anushreebasics commented Jan 6, 2026

fixes #555

Create a two-level nested InlinePanel:
Screenshot 2026-01-06 at 9 09 36 PM

@thibaudcolas @simonw @cnk please review this PR and let me know if any changes are required

Copilot AI review requested due to automatic review settings January 6, 2026 15:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a two-level nested InlinePanel structure to demonstrate and test Wagtail's nested InlinePanel functionality. The implementation adds new models for organizing location operating hours in a hierarchical structure where each day can contain multiple time slots.

  • Introduces LocationWeekDaySlot and LocationHourSlot models to create a nested InlinePanel structure
  • Adds a test script to verify and demonstrate the nested InlinePanel functionality
  • Includes database migration to create the new models

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
bakerydemo/locations/models.py Adds two new models (LocationWeekDaySlot and LocationHourSlot) with ClusterableModel inheritance, ParentalKey relationships, and panel configurations for nested InlinePanel support. Updates LocationPage to include the new nested structure alongside the existing flat structure.
bakerydemo/locations/migrations/0009_locationweekdayslot_locationhourslot.py Creates database tables for the new LocationWeekDaySlot and LocationHourSlot models with appropriate fields, relationships, and ordering configuration.
bakerydemo/test_nested_inline.py Adds a test/demonstration script that queries and displays the nested InlinePanel structure, providing instructions for testing the feature in the admin interface.
Comments suppressed due to low confidence (1)

bakerydemo/locations/models.py:270

  • The new nested InlinePanel structure (week_day_slots) is added to the content_panels but is missing from the api_fields list. For consistency with the existing hours_of_operation field which is exposed in the API, consider adding an APIField for week_day_slots to the api_fields list if this data should be accessible via the API.
    api_fields = [
        APIField("introduction"),
        APIField("image"),
        APIField("body"),
        APIField("address"),
        APIField("lat_long"),
        APIField("is_open"),
        APIField("hours_of_operation"),
    ]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

print(" • Expand/collapse functionality per day")
print(" • Multiple time slots within each day")
print(" • Scroll behavior with nested panels")
print(" • Related to Wagtail issue #13352")
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test script references "Wagtail issue #13352", but the PR description mentions "fixes #555". These issue numbers should be consistent. Please verify which issue number is correct and update accordingly.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +16
LocationWeekDaySlot,
LocationHourSlot,
)

Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'LocationWeekDaySlot' is not used.
Import of 'LocationHourSlot' is not used.

Suggested change
LocationWeekDaySlot,
LocationHourSlot,
)
)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested InlinePanel demo

1 participant