Flask Admin嵌套内联_模型

2024-09-30 03:24:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在寻找一个内联模型包含另一个内联模型的能力。如果这种行为是可能的,我假设这将实现:

inline_models = (
    (
        SomeModel,
        {
            'form_columns': ('id', 'another_model_attribute', 'some_attribute'),
            'inline_models': (
                (
                    AnotherModel,
                    {
                        'form_columns': ('id', 'some_other_attribute'),
                    },
                ),
            )
        },
    ),
)

不幸的是,这似乎毫无作用。有人知道这在flask admin中是否可行吗?或者可能有另一种解决方案来实现这种行为

thisgithub帖子中,一位用户使用他们提供的屏幕截图让人觉得这是可能的,但没有任何代码被链接


Tags: columns模型formidflaskmodelmodelsanother

热门问题