django-taggit

What is the difference between ChildPage.objects.child_of(self) and ParentPage.get_children()?

六月ゝ 毕业季﹏ 提交于 2021-01-29 15:21:14
问题 I think that ChildPage.objects.child_of(self) and ParentPage.get_children() produce same result because subpage_types of ParentPage is just one ['ChildPage'] . But when I try to filter the result of ParentPage.get_children() there is an error. def get_context(self, request, *args, **kwargs): context = super().get_context(request, *args, **kwargs) child = self.get_children().live().public() # <- don't works child = ChildPage.objects.child_of(self).live().public() # <- works if request.GET.get(

How to set multiple ParentalKeys to Wagtail TaggedItemBase tag class

蹲街弑〆低调 提交于 2020-12-23 08:19:07
问题 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 motorcycles. I'm making a separate page with a table of their parts (which also needs to contain columns like "id" which i assume can be a pk,"web store link", and "used by" which will show all Bike and Car models that use the part); Since they can share a few of the same parts, I want for them to be connected to the same Tag model

How to set multiple ParentalKeys to Wagtail TaggedItemBase tag class

自作多情 提交于 2020-12-23 08:18:12
问题 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 motorcycles. I'm making a separate page with a table of their parts (which also needs to contain columns like "id" which i assume can be a pk,"web store link", and "used by" which will show all Bike and Car models that use the part); Since they can share a few of the same parts, I want for them to be connected to the same Tag model

How to set multiple ParentalKeys to Wagtail TaggedItemBase tag class

允我心安 提交于 2020-12-23 08:17:19
问题 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 motorcycles. I'm making a separate page with a table of their parts (which also needs to contain columns like "id" which i assume can be a pk,"web store link", and "used by" which will show all Bike and Car models that use the part); Since they can share a few of the same parts, I want for them to be connected to the same Tag model

additional fields associated with wagtail tags?

試著忘記壹切 提交于 2020-11-29 11:12:08
问题 I'm creating wagtail website that copies and adds to the functionality of old django website: there is a blog-like "animal-listing" and "plant-listing" pages with post-detail-like "animal detail" and "plant detail" pages. They share a common "need" tag via simple ManyToManyField, because animals and plants have some of the same needs (like water or hay). Need tags are displayed on the "needs page" table, which has columns like "store link". This original solution weren't as smooth as

additional fields associated with wagtail tags?

♀尐吖头ヾ 提交于 2020-11-29 11:11:07
问题 I'm creating wagtail website that copies and adds to the functionality of old django website: there is a blog-like "animal-listing" and "plant-listing" pages with post-detail-like "animal detail" and "plant detail" pages. They share a common "need" tag via simple ManyToManyField, because animals and plants have some of the same needs (like water or hay). Need tags are displayed on the "needs page" table, which has columns like "store link". This original solution weren't as smooth as

Using Django-taggit and django-taggit-serializer with issue

ぐ巨炮叔叔 提交于 2020-04-30 09:31:53
问题 I am trying to add tags in my model by taggit and taggit serializer. I making my API in rest framework. I followed the instruction(https://github.com/glemmaPaul/django-taggit-serializer) but it is still an issues: "tags": [ "Invalid json list. A tag list submitted in string form must be valid json."] /setting.py INSTALLED_APPS = [ [...] 'rest_framework', 'taggit', 'taggit_serializer', ] /models.py tags = TaggableManager(blank = True) /serializer.py class JobSerializer(TaggitSerializer

Using Django-taggit and django-taggit-serializer with issue

半城伤御伤魂 提交于 2020-04-30 09:31:14
问题 I am trying to add tags in my model by taggit and taggit serializer. I making my API in rest framework. I followed the instruction(https://github.com/glemmaPaul/django-taggit-serializer) but it is still an issues: "tags": [ "Invalid json list. A tag list submitted in string form must be valid json."] /setting.py INSTALLED_APPS = [ [...] 'rest_framework', 'taggit', 'taggit_serializer', ] /models.py tags = TaggableManager(blank = True) /serializer.py class JobSerializer(TaggitSerializer

How do I create list and detail views for django-taggit?

吃可爱长大的小学妹 提交于 2020-02-17 15:02:43
问题 I have a fairly simple model that uses Django Taggit for tagging. Everything works great, but now I'd like to expand some functionality and I'm a little confused. What I want is two views. One that shows all my tags in the system. One that shows all the content from my app with a specific tag. What makes sense to me is to do the following for each view. in views.py for myapp All Tags from myapp.models import App from taggit.models import Tag class TagList(ListView): """ Get all the tags in