Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4571 closed (fixed)

small patch for multi model admin.site 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

Description

the code bellow:

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

would cause error:

proj.app: 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 17 years ago.
issubclass => is not tuple or list

Download all attachments as: .zip

Change History (3)

by Jakub Vysoky, 17 years ago

issubclass => is not tuple or list

comment:1 by Russell Keith-Magee, 17 years ago

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 by Russell Keith-Magee, 17 years ago

(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