Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Compound Fields only for is_list #1071

Closed
wants to merge 1 commit into from

Conversation

skinkie
Copy link
Contributor

@skinkie skinkie commented Aug 25, 2024

📒 Description

A follow up on #1065.

CompoundFields currently aggregate choices, but the description mentions "repeatable fields". Which allows it to render a choice item in the found order. In the regular case where an object has two fields, and either one of those fields must be set (or read) I would prefer to access that field by its field name, not field1_field2 or choice. There is only one situation - I am aware of - where I want to maintain order: this is when the choice field is part of a sequence with maxOccurs > 1, hence it becomes a List.

Resolves #1070.

🔗 What I've Done

At the compound field generation stage, explicitly check if any of the grouped attrs is in fact a list. In otherwise we assume that it is not.

💬 Comments

Now there must likely be a situation where this approach fails. And I wonder how the generation 'compound-fields' handles multiple elements, where only one is allowed. But this would be an issue for the existing code too.

🛫 Checklist

Copy link

@tefra tefra marked this pull request as draft August 25, 2024 05:49
@skinkie skinkie closed this Aug 28, 2024
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.

Compound Fields only for Iterables
1 participant