Skip to content

Commit

Permalink
Register as snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit Vermeulen committed Feb 7, 2024
1 parent 0d14a06 commit cc9136e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,9 +983,10 @@ def update_embedding(sender, instance, *args, **kwargs):

instance.embedding = embedding


class OrderedContentSet(DraftStateMixin, RevisionMixin, index.Indexed, models.Model):
revisions = GenericRelation("wagtailcore.Revision", related_query_name="orderedcontentset")
revisions = GenericRelation(
"wagtailcore.Revision", related_query_name="orderedcontentset"
)
name = models.CharField(
max_length=255, help_text="The name of the ordered content set."
)
Expand Down
2 changes: 2 additions & 0 deletions home/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from wagtail.admin import widgets as wagtailadmin_widgets
from wagtail.admin.menu import AdminOnlyMenuItem
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail.snippets.models import register_snippet

from .models import ContentPage, OrderedContentSet

Expand All @@ -15,6 +16,7 @@
ContentUploadView,
)

register_snippet(OrderedContentSet)

@hooks.register("register_admin_urls")
def register_import_urls():
Expand Down

0 comments on commit cc9136e

Please sign in to comment.