Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Removed usage of field.choices that triggered full table load#8950

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
auvipy merged 1 commit intoencode:masterfromlnagel:patch-1
Jun 13, 2023
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@
{% endif %}

<divclass="col-sm-10">
<selectmultiple{{field.choices|yesno:",disabled" }}class="form-control"name="{{ field.name }}">
Copy link
Collaborator

Choose a reason for hiding this comment

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

how can we determine this won't create any regression?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

From my side I will include the modified template in our current projects. So far this seems to have resolved the issue of forms not loading within 30 seconds that the application server is willing to wait on DRF request processing and the end user getting a gateway timeout.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Another way to reason about this: as long as field.choices are present (field queryset is non-empty), then the select element is not assigned the "disabled" html attribute. Theoretically speaking it should not matter whether a multi-select field without any choices is disabled or enabled - there isn't anything to select.

Is anyone aware of some corner case situation that we should be aware of?

auvipy reacted with thumbs up emoji
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it possible to add test coverage for this?

<selectmultipleclass="form-control"name="{{ field.name }}">
{% for select in field.iter_options %}
{% if select.start_option_group %}
<optgrouplabel="{{ select.label }}">
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp