linuxsoftware / ls.joyous

A calendar application for Wagtail
BSD 3-Clause "New" or "Revised" License
74 stars 35 forks source link

Use max_count to restrict CalendarPage creation #13

Closed zerolab closed 5 years ago

zerolab commented 5 years ago

There can only be one CalendarPage per Wagtail site, so if you wish to repeat step 5 you will have to delete this one first.

The above note reminded me about the max_count attribute introduced in Wagtail 2.4

https://docs.wagtail.io/en/v2.5/reference/pages/model_reference.html#wagtail.core.models.Page.max_count

linuxsoftware commented 5 years ago

Thanks for the suggestion, but I will stick with overriding can_create_at.

  1. I can continue to support Wagtail 2.3
  2. I can limit the restriction to being per-site
  3. I can filter by ContentType