Skip to content

Commit

Permalink
Remove trailing whitespace from xeditable.py.
Browse files Browse the repository at this point in the history
Cleaning up the trailing whitespace in `xeditable.py` improves code readability and adheres to coding standards. No functional changes have been made.
  • Loading branch information
rh0dium committed Nov 11, 2024
1 parent 80f8f91 commit 7af6088
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datatableview/views/xeditable.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ def _get_foreignkey_choices(self, field, field_name):
# will consequently try to assume initial=None, forcing the blank option to appear.
formfield_kwargs["empty_label"] = None
formfield = field.formfield(**formfield_kwargs)

# In case of using Foreignkey limit_choices_to, django prepares model form and handles
# form validation correctly, so does django-datatableview with x-editable plugin. However
# this piece of code helps filtering limited choices to be only visible choices,else
# all the choices are visible.
if formfield.limit_choices_to:
formfield.queryset = formfield.queryset.filter(**formfield.limit_choices_to)

# return formfield.choices
# formfield choices deconstructed to get ModelChoiceIteratorValue correctly (>= Django 3.1)
# https://docs.djangoproject.com/en/3.2/ref/forms/fields/#django.forms.ModelChoiceIteratorValue.value
Expand Down

0 comments on commit 7af6088

Please sign in to comment.