mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-05 07:31:06 +00:00
The destination of the ParentalKey should be a subclass of ClusterableModel
This commit is contained in:
parent
a0af3d6685
commit
ffbe4730f0
1 changed files with 2 additions and 1 deletions
|
|
@ -213,6 +213,7 @@ Adding tags to snippets is very similar to adding tags to pages. The only differ
|
|||
.. code-block:: python
|
||||
|
||||
from modelcluster.fields import ParentalKey
|
||||
from modelcluster.models import ClusterableModel
|
||||
from taggit.models import TaggedItemBase
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
|
|
@ -220,7 +221,7 @@ Adding tags to snippets is very similar to adding tags to pages. The only differ
|
|||
content_object = ParentalKey('demo.Advert', related_name='tagged_items')
|
||||
|
||||
@register_snippet
|
||||
class Advert(models.Model):
|
||||
class Advert(ClusterableModel):
|
||||
...
|
||||
tags = TaggableManager(through=AdvertTag, blank=True)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue