Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@smk4664
Copy link
Contributor

@smk4664 smk4664 commented May 20, 2021

Fixes: #459

Fixes the field_order Meta option to jobs.

I can add tests for these, I noticed none of the tests for Jobs tested any of the optional attributes (Name, Description, Commit_Default). We might want to make that a followup ticket...

Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good and straightforward fix/enhancement - thank you!

Since _commit is automatically added to the form fields, the job author may not think to include it in field_order - when we call order_fields, what happens to fields that aren't in the list, do they get sent to the start or the end of the form?

It would be nice to add a quick test or two for as_form() with and without a specified field_order, if you're up for doing that.

@smk4664
Copy link
Contributor Author

smk4664 commented May 20, 2021

Per Django Docs, anything not provided by field_order would be appended to the bottom per the default order that Django would decide.

https://docs.djangoproject.com/en/3.2/ref/forms/api/#django.forms.Form.field_order

I will see what I can do about tests.

@smk4664 smk4664 changed the title Adds ability to define the field_order in jobs. Fixes inability to define the field_order in jobs. May 20, 2021
# Conflicts:
#	nautobot/docs/release-notes/version-1.0.md
@smk4664 smk4664 requested a review from glennmatthews May 24, 2021 14:36
Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

smk4664 and others added 2 commits May 24, 2021 10:18
# Conflicts:
#	nautobot/docs/release-notes/version-1.0.md
@glennmatthews glennmatthews merged commit 79e0168 into nautobot:develop May 24, 2021
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.

Job Rendering Does Not Follow field_order Defined in Meta

4 participants