Skip to content

Add function to grab items from fieldset#79

Open
alex-dicko wants to merge 1 commit into
fusionbox:masterfrom
alex-dicko:fix/boundfieldset-attr-passthrough
Open

Add function to grab items from fieldset#79
alex-dicko wants to merge 1 commit into
fusionbox:masterfrom
alex-dicko:fix/boundfieldset-attr-passthrough

Conversation

@alex-dicko

Copy link
Copy Markdown

Added a small function to BoundFieldset to get items from the fieldsets:

I wanted to add a new field "columns" to a fieldset:

class ThemeConfigForm(BetterModelForm):
    class Meta:
        model = ThemeConfig
        fields = '__all__'
        fieldsets = [
            ('general_information', {
                'legend': 'General Information',
                'columns' 4,
                'fields': [
                    ...
                ]
            }),
        ]
<div class="col-12 col-lg-{% if fieldset.columns %}{{ fieldset.columns }}{% else %}{{ columns }}{% endif   %}">
    ...
</div>

Otherwise you would have to do fieldset.fieldset.columns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant