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

Fix multi-fields in single line #539

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Conversation

morsik
Copy link
Contributor

@morsik morsik commented Apr 8, 2023

As Django documentation states, you may use:

{
    "fields": [("first_name", "last_name"), "address", "city", "state"],
}

to specify that first_name and last_name should be displayed in single line.

Django Polymorphic though wasn't able to work with this syntax properly as it tried to remove whole tuple instead of individual elements from child fields.

This PR fixes this, and now multi-field lines are rendered correctly.

j-antunes pushed a commit to j-antunes/django-polymorphic that referenced this pull request Nov 14, 2023
@jleclanche jleclanche merged commit bd2ff0b into jazzband:master Nov 17, 2023
@morsik
Copy link
Contributor Author

morsik commented Nov 18, 2023

@jleclanche have you checked this PR? I totally forgot about this, but after reading it right now again, it seems I did big mistake in it!

In this PR I removed for field in fieldset[1]["fields"]: in this PR, but I think it should stayed as it was, and all my code and else statement with original code should be just inside for loop...

Otherwise theres no field available to use with my if isinstance(field, tuple) :/
Sorry!

@jleclanche
Copy link
Member

@j-antunes could you submit the corrected version you merged recently?

morsik added a commit to morsik/django-polymorphic that referenced this pull request Nov 18, 2023
morsik added a commit to morsik/django-polymorphic that referenced this pull request Nov 18, 2023
@morsik
Copy link
Contributor Author

morsik commented Nov 18, 2023

@jleclanche fixed, see PR above ^

@j-antunes actually copied correct part of the code in his commit from my PR without removing that one line that shouldn't be removed.

jleclanche pushed a commit that referenced this pull request Nov 18, 2023
@j-antunes
Copy link
Contributor

@morsik - Awesome thank you!

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.

3 participants