Django

Code

Ticket #4571 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

small patch for multi model admin.site registering

Reported by: Jakub Vysoky [kvbik] Assigned to: adrian
Milestone: Component: django.contrib.admin
Version: newforms-admin Keywords: issubclass model_or_iterable
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation:
Needs tests: Patch needs improvement:

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

django_newadmin_iterable.diff (0.9 kB) - added by Jakub Vysoky on 06/15/07 07:49:04.
issubclass => is not tuple or list

Change History

06/15/07 07:49:04 changed by Jakub Vysoky

  • attachment django_newadmin_iterable.diff added.

issubclass => is not tuple or list

08/24/07 08:38:10 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

(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.

08/24/07 09:27:08 changed by russellm

(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!!


Add/Change #4571 (small patch for multi model admin.site registering)




Change Properties
Action