Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#125 closed defect (wontfix)

View-Controller separation violation

Reported by: maurycy Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


For example, django.views.admin.main:

    if lookup_opts.admin.search_fields:
        raw_template.append('<div id="toolbar">\n<form id="changelist-search" action="" method="get">\n')
        raw_template.append('<label><img src="%simg/admin/icon_searchbox.png" /></label> ' % ADMIN_MEDIA_PREFIX)
        raw_template.append('<input type="text" size="40" name="%s" value="%s" id="searchbar" /> ' % \
            (SEARCH_VAR, escape(query)))

Shouldn't it be done only with templates?

Change History (2)

comment:1 Changed 14 years ago by maurycy

Additionally, it makes harder to fix #115.

comment:2 Changed 14 years ago by Adrian Holovaty

Resolution: wontfix
Status: newclosed

The automatic admin generation is a special-case. The template is hard-coded for that, because it would be way too complex if we used a template to generate the template. We broke the rule on purpose for this isolated case.

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