开发者

Django admin fieldset exclude or header field

开发者 https://www.devze.com 2023-03-27 15:08 出处:网络
I\'m trying to create a new admin view that: 1. has a h开发者_C百科eader of some kind 2. excludes 3 of my fields

I'm trying to create a new admin view that: 1. has a h开发者_C百科eader of some kind 2. excludes 3 of my fields

Fieldset gives me the header I want, but doesn't seem to support "exclude", and I have not been able to find a "header" field.

Is there: 1. a header field that I don't know about 2. a way to exclude fields within Fieldset?


You can't exclude things the way you want to, unfortunately. You'll have to verbosely list every field that you want to include, like this:

fieldsets = (
    ('Basic Information', {
        'fields': ('first_name', 'last_name', 'address', )
    }),
)

And so on!

0

精彩评论

暂无评论...
验证码 换一张
取 消