Python 我可以在另一个订单中放入一个订单吗?

Python 我可以在另一个订单中放入一个订单吗?,python,html,django,wagtail,Python,Html,Django,Wagtail,我有这样的设置,我的医嘱允许我添加多张卡片来显示pdf文档。但是,有没有办法在InLinePanel中显示医嘱内容 例如,我想有20张卡片,但在这些卡片中,PDF的数量将从1到10不等。我想要这个,因为它使PDF很容易找到,而且很容易操作 class ArchitectPage(Page): search_fields = Page.search_fields + [ ] # these are if adding a search to the website

我有这样的设置,我的医嘱允许我添加多张卡片来显示pdf文档。但是,有没有办法在InLinePanel中显示医嘱内容

例如,我想有20张卡片,但在这些卡片中,PDF的数量将从1到10不等。我想要这个,因为它使PDF很容易找到,而且很容易操作


class ArchitectPage(Page):
    search_fields = Page.search_fields + [

    ]  # these are if adding a search to the website

    # content tab panels
    content_panels = Page.content_panels + [
        MultiFieldPanel(
            [InlinePanel('architect_pdf', max_num=20, min_num=0, label="architect doc")],
            heading="architect pdf"
        ),
    ]

    # what to call the panels on wagtail
    edit_handler = TabbedInterface([
        ObjectList(content_panels, heading='Content'),
        ObjectList(Page.promote_panels, heading='SEO'),
        ObjectList(Page.settings_panels, heading='Settings', classname='settings'),
        # classname settings adds the cog
    ])


class ArchitectDownloads(Orderable):
    page = ParentalKey(ArchitectPage, on_delete=models.CASCADE, related_name='architect_pdf')
    architect_pdf = models.ForeignKey(
        'wagtaildocs.Document',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )
    image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.CASCADE,
        related_name='+'
    )
    caption = models.CharField(blank=True, max_length=250)

    panels = [
        ImageChooserPanel('image'),
        FieldPanel('caption'),
        DocumentChooserPanel('architect_pdf'),
    ]
{%可在page.architect\u pdf.all%}
{%image下载。image fill-150x150-c100%}
{%with doc=download.architect\u pdf%}
{{doc.title}
{%endwith%}

{{download.caption}

{%with doc=download.architect\u pdf%} {%endwith%} {%endfor%}

这似乎是wagtail中没有添加的内容,但Kalob Taulein已经制作了一个很好的教程,介绍了一个外观相同的替代方案

下面是实现它们所需的两个教程


这似乎是wagtail中没有添加的内容,但Kalob Taulein已经制作了一个很好的教程,介绍了一个外观相同的替代方案

下面是实现它们所需的两个教程

{% for download in page.architect_pdf.all %} 

            <div class="document line-up-card">
                <div class="w3-card-4 w3-margin w3-white" data-aos="fade-down">


                    {% image download.image fill-150x150-c100 %}
                    {% with doc=download.architect_pdf %} 

                        <div class="w3-container">
                            {{ doc.title }}
                        </div>

                    {% endwith %}

                  <hr>
                    <p id="caption">{{ download.caption }}</p>

                    {% with doc=download.architect_pdf %}

                        <div class="download">
                            <a href="{{ doc.url }}" class="smooth-over-button noDecoration">
                                <i class="fa fa-download"></i>
                                <p class="btn-txt">PDF</p>
                            </a>

                        </div>

                    {% endwith %}


                </div>
            </div>

{% endfor %}