Opened 18 years ago

Closed 17 years ago

#4326 closed (duplicate)

Fixed two bugs in newforms-admin branch

Reported by: yi.codeplayer at gmail dot com Owned by: Adrian Holovaty
Component: contrib.admin Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

  1. the code bellow would cause error:
    from django.contrib import admin
    admin.site.register([Model1, Model2], SomeAdminClass)
    

in contrib/admin/sites.py AdminSite::register , when calling issubclass(model_or_iterable, Model) , it would complain that model_or_iterable is not class (because it's instance of list).

  1. In the index page of new admin , each model is displayed in a seperated app section, there is only one model in each app section (i don't know exactly how to describe it , hope you can understand). this patch make it behavie normal.

Attachments (2)

django_new_admin_2_bug_fixed.patch (2.5 KB ) - added by yi.codeplayer at gmail dot com 18 years ago.
The Patch.
django_new_admin_bug_fixed.patch (3.2 KB ) - added by yi.codeplayer at gmail dot com 18 years ago.
Add two things: 1. Make model registry OrderDict 2. use model.__name__ instead of model.__class__.__name__ when raise exception AlreadyRegistered because model is a class.

Download all attachments as: .zip

Change History (8)

by yi.codeplayer at gmail dot com, 18 years ago

The Patch.

by yi.codeplayer at gmail dot com, 18 years ago

Add two things: 1. Make model registry OrderDict 2. use model.__name__ instead of model.__class__.__name__ when raise exception AlreadyRegistered because model is a class.

comment:1 by Adrian Holovaty, 18 years ago

yi.codeplayer: Thanks for the report and patch, but please split these sorts of things across separate tickets in the future. (No need to change this one, as it's already been submitted, but I'm making a suggestion for next time.)

comment:2 by Adrian Holovaty, 18 years ago

Version: newforms branchnewforms-admin

comment:3 by Adrian Holovaty, 18 years ago

This patch is slightly out of date -- [5441] fixed the index-page ordering thing in a slightly different way.

comment:4 by Adrian Holovaty, 18 years ago

Keywords: newadmin removed
Triage Stage: UnreviewedAccepted

comment:5 by Jakub Vysoky, 18 years ago

I made only the first change in #4571.

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

Resolution: duplicate
Status: newclosed

As noted by Adrian, Issue 2 has been resolved in [5441]; Issue 1 is is duplicated by #4571. I'm marking this ticket as a duplicate for the sake of clarity.

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