I have two different page models (no subclassing, separate apps with only similar fields being common ones like \"model name\", \"id\", \"parts\") , let\'s say, cars and mot
Setting up separate CarPageTag
and BikePageTag
models is the solution you want (assuming they're subclasses of TaggedItemBase
, as per the pattern shown in the Wagtail documentation).
TaggedItemBase
is not a tag model itself - it just defines the relation between the page model and the tag model (which, in this case, is taggit.Tag
, the standard tag model provided as default by the django-taggit library). Therefore, CarPageTag
is setting up a relation between CarPage
and taggit.Tag
, and BikePageTag
is setting up a relation between BikePage
and taggit.Tag
- both are using the same tag model.
If you did want cars and bikes to maintain their own independent set of tags, you'd need a different pattern - custom tag models.