Skip to content

Commit

Permalink
fix promote inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Jan 29, 2024
1 parent e772df0 commit 4704776
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.1.7 on 2024-01-29 22:44

import books.models
from django.db import migrations
import snippets.models
import wagtail.fields


class Migration(migrations.Migration):
dependencies = [
("books", "0151_book_promote_snippet_promotesnippets"),
]

operations = [
migrations.AlterField(
model_name="book",
name="promote_snippet",
field=wagtail.fields.StreamField(
[("content", books.models.PromoteSnippetContentChooserBlock(snippets.models.PromoteSnippet))],
blank=True,
null=True,
use_json_field=True,
),
),
migrations.DeleteModel(
name="PromoteSnippets",
),
]
5 changes: 1 addition & 4 deletions books/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def get_api_representation(self, value, context=None):


class PromoteSnippetBlock(blocks.StreamBlock):
content = SharedContentChooserBlock(snippets.PromoteSnippet)
content = PromoteSnippetContentChooserBlock(snippets.PromoteSnippet)

class Meta:
icon = 'snippet'
Expand Down Expand Up @@ -490,9 +490,6 @@ class K12BookSubjects(Orderable, K12SubjectBooks):
class BookCategories(Orderable, BookCategory):
book_category = ParentalKey('books.Book', related_name='book_categories')

class PromoteSnippets(Orderable, snippets.PromoteSnippet):
promote_snippet = ParentalKey('books.Book', related_name='promote_snippets')


class Book(Page):
licenses = (
Expand Down

0 comments on commit 4704776

Please sign in to comment.