Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4571 closed (fixed)

small patch for multi model registering

Reported by: Jakub Vysoky [kvbik] Owned by: Adrian Holovaty
Component: contrib.admin Version: newforms-admin
Severity: Keywords: issubclass model_or_iterable
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


the code bellow:

from django.contrib import admin[Model1, Model2], SomeAdminClass)

would cause error: issubclass() arg 1 must be a class

when calling issubclass(model_or_iterable, Model),
it would complain that model_or_iterable is not class (because it's instance of list).

Attachments (1)

django_newadmin_iterable.diff (916 bytes) - added by Jakub Vysoky 12 years ago.
issubclass => is not tuple or list

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by Jakub Vysoky

issubclass => is not tuple or list

comment:1 Changed 12 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [5999]) newforms-admin: Fixed #4571 -- Clarified type check to allow multiple class registrations with an admin site. Thanks to Jakub Vysoky for the patch.

comment:2 Changed 12 years ago by Russell Keith-Magee

(In [6000]) newforms-admin: Fixed #4810, Refs #4571 -- Reversed the logic for the type check introduced in [5999]; this way should be a little more robust from an error handling point of view. Thanks to ubernostrum for the suggestion. Oh, and Changeset 6000!! w00t!!

Note: See TracTickets for help on using tickets.
Back to Top