Opened 8 years ago

Closed 8 years ago

#4326 closed (duplicate)

Fixed two bugs in newforms-admin branch

Reported by: yi.codeplayer at gmail dot com Owned by: adrian
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: UI/UX:

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 8 years ago.
The Patch.
django_new_admin_bug_fixed.patch (3.2 KB) - added by yi.codeplayer at gmail dot com 8 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)

Changed 8 years ago by yi.codeplayer at gmail dot com

The Patch.

Changed 8 years ago by yi.codeplayer at gmail dot com

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 Changed 8 years ago by adrian

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 8 years ago by adrian

  • Version changed from newforms branch to newforms-admin

comment:3 Changed 8 years ago by adrian

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

comment:4 Changed 8 years ago by adrian

  • Keywords newadmin removed
  • Triage Stage changed from Unreviewed to Accepted

comment:5 Changed 8 years ago by Jakub Vysoky

I made only the first change in #4571.

comment:6 Changed 8 years ago by russellm

  • Resolution set to duplicate
  • Status changed from new to closed

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