Django Admin: How to Override Add Form to Choose Existing Object Instead of Raising 'Already Exists' Error?
I am working with Django and using the Django admin panel for managing a model called Keyword. When adding a new instance of the Keyword model, I want to customize the behavior so that if the keyword already exists, the admin form should select the existing keyword instead of raising the 'Already Exists' error.
I have attempted various approaches, including custom forms and overriding the save_model method in the admin class, but the issue persists. The current implementation still raises a "Keyword with this Name already exists" error.