Code

Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#125 closed defect (wontfix)

View-Controller separation violation

Reported by: maurycy Owned by: adrian
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: UI/UX:

Description

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?

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by maurycy

Additionally, it makes harder to fix #115.

comment:2 Changed 9 years ago by adrian

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

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.