From 2c927df5baf4242205c3cc9c426a13e3a5b0d929 Mon Sep 17 00:00:00 2001
From: ibaguio <baguio.ivan@gmail.com>
Date: Wed, 10 Aug 2022 10:55:08 +0800
Subject: [PATCH] Add BaseAdmin.get_raw_id_fields hook
---
django/contrib/admin/options.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 8ccacd6213..52e093e87b 100644
a
|
b
|
class BaseModelAdmin(metaclass=forms.MediaDefiningClass):
|
337 | 337 | """ |
338 | 338 | return self.autocomplete_fields |
339 | 339 | |
| 340 | def get_raw_id_fields(self, request): |
| 341 | """ |
| 342 | Return a list of ForeignKey and/or ManyToMany fields which should use |
| 343 | a raw id widget. |
| 344 | """ |
| 345 | return self.raw_id_fields |
| 346 | |
340 | 347 | def get_view_on_site_url(self, obj=None): |
341 | 348 | if obj is None or not self.view_on_site: |
342 | 349 | return None |