Skip to content

ForeignKeyWidget: add get_lookup_kwargs()#1651

Merged
matthewhegarty merged 2 commits intodjango-import-export:release-4from
matthewhegarty:issue-1516-add-get-lookup-kwargs
Oct 11, 2023
Merged

ForeignKeyWidget: add get_lookup_kwargs()#1651
matthewhegarty merged 2 commits intodjango-import-export:release-4from
matthewhegarty:issue-1516-add-get-lookup-kwargs

Conversation

@matthewhegarty
Copy link
Contributor

Problem

Closes #1516
In order to override ForeignKey lookup you have to override the clean() method.

Solution

Add an overrideable method get_lookup_kwargs()

Also fixes a bug in the test app where the author's birthday could never be set.

Acceptance Criteria

Test added.

Copy link

@rpsands rpsands left a comment

Choose a reason for hiding this comment

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

Nice! This granularity is useful all over in terms of improving the customizability.

@matthewhegarty matthewhegarty merged commit 0e5ee68 into django-import-export:release-4 Oct 11, 2023
@matthewhegarty matthewhegarty deleted the issue-1516-add-get-lookup-kwargs branch October 11, 2023 12:17
Viicos added a commit to Viicos/typeshed that referenced this pull request Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants