Python DjangoCMS插件列出apphook模型中的特定人员

Python DjangoCMS插件列出apphook模型中的特定人员,python,django,plugins,django-cms,Python,Django,Plugins,Django Cms,我是DjangoCMS的新手。因此,如果这个问题太琐碎,请容忍我 我已经做了一个应用程序挂钩,为一个有 model.py from django.db import models from filer.fields.image import FilerImageField from djangocms_text_ckeditor.fields import HTMLField from django.urls import reverse from cms.models.fields impor

我是DjangoCMS的新手。因此,如果这个问题太琐碎,请容忍我

我已经做了一个应用程序挂钩,为一个有 model.py

from django.db import models
from filer.fields.image import FilerImageField
from djangocms_text_ckeditor.fields import HTMLField
from django.urls import reverse
from cms.models.fields import PlaceholderField

# Create your models here.

class Designations(models.Model):
    class Meta:
        app_label = 'voxstaff'
        verbose_name_plural = 'designations'
    desingation = models.CharField(
        blank=False,
        help_text="Please provide a label for the Designation",
        unique=True,
        max_length=100
    )

    def __str__(self):
        return self.desingation

class Staffs(models.Model):

    class Meta:
        app_label = 'voxstaff'

    full_name = models.CharField(
        blank=False,
        unique=True,
        help_text="Please enter the full name of the staff",
        max_length=100
    )

    slug = models.SlugField(
        blank=False,
        default='',
        help_text='Provide a unique slug for this staff member',
        max_length=100,
    )

    desingation = models.ForeignKey(
        Designations,
        on_delete=models.SET_NULL,
        blank=True,
        null=True
    )

    photo = FilerImageField(
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    staff_intro = HTMLField(blank=True)
    
    

    bio = PlaceholderField("staff_bio")

    is_featured = models.BooleanField()

    def get_absolute_url(self):
        return reverse("voxstaff:staffs_detail", kwargs={"slug": self.slug})
        

    def __str__(self):
        return self.full_name

class LinkTypes(models.Model):
    link_type = models.CharField(max_length=100)
    
    def __str__(self):
        return self.link_type


class Links(models.Model):
    staff = models.ForeignKey(Staffs,on_delete=models.CASCADE)
    link_type = models.ForeignKey(LinkTypes,on_delete=models.SET_NULL,null=True,blank=True)
    link_url = models.CharField(max_length=200)

    def __str__(self):
        return self.link_type.link_type
cms_apps.py如下

from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _

from .menu import StaffSubMenu

@apphook_pool.register
class StaffApp(CMSApp):
    name = _('VOXStaff')
    # urls = ['voxstaff.urls', ]
    app_name = 'voxstaff'
    menus = [StaffSubMenu, ]
    def get_urls(self, page=None, language=None, **kwargs):
        return ["voxstaff.urls"]
现在我需要一个插件,显示在主页上的工作人员。在员工模型中,这些员工应具有的特征


如何进行相同的操作。请帮忙,我卡住了。

我可以通过下面的帖子来满足我的要求

这个问题可以结束了