mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #373 -- Added CompositePrimaryKey.
Thanks Lily Foote and Simon Charette for reviews and mentoring this Google Summer of Code 2024 project. Co-authored-by: Simon Charette <charette.s@gmail.com> Co-authored-by: Lily Foote <code@lilyf.org>
This commit is contained in:
committed by
Sarah Boyce
parent
86661f2449
commit
978aae4334
@@ -113,6 +113,11 @@ class AdminSite:
|
||||
"The model %s is abstract, so it cannot be registered with admin."
|
||||
% model.__name__
|
||||
)
|
||||
if model._meta.is_composite_pk:
|
||||
raise ImproperlyConfigured(
|
||||
"The model %s has a composite primary key, so it cannot be "
|
||||
"registered with admin." % model.__name__
|
||||
)
|
||||
|
||||
if self.is_registered(model):
|
||||
registered_admin = str(self.get_model_admin(model))
|
||||
|
||||
Reference in New Issue
Block a user