Opened 18 years ago
Closed 18 years ago
#5286 closed (fixed)
Non-HTML output in python manage.py adminindex <appname>
| Reported by: | Owned by: | Alexander Solovyov | |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | Keywords: | admin adminindex manage.py repr str proxy | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
This is on Django trunk rev 6023, running on python 2.4.3 compiled from source on Mac OS X 10.4.10, running with PostgreSQL (again from source) 8.1.4.
I created a simple project 'qwacks' with a single app 'diary'. I created a very simple model (attached). Settings and configuration also attached. I then added a custom directory to TEMPLATE_DIRS, preparing to customise teh Django index page as described in http://www.djangoproject.com/documentation/tutorial02/.
Upon running python manage.py adminindex diary, I get the following output:
{% if perms.diary %}
<div class="module"><h2>Diary</h2><table>
{% if perms.diary.add_event or perms.diary.change_event %}
<tr>
<th>{% if perms.diary.change_event %}<a href="diary/event/">{% endif %}<django.utils.functional.__proxy__ object at 0x1381550>{% if perms.diary.change_event %}</a>{% endif %}</th>
<td class="x50">{% if perms.diary.add_event %}<a href="diary/event/add/" class="addlink">{% endif %}Add{% if perms.diary.add_event %}</a>{% endif %}</td>
<td class="x75">{% if perms.diary.change_event %}<a href="diary/event/" class="changelink">{% endif %}Change{% if perms.diary.change_event %}</a>{% endif %}</td>
</tr>
{% endif %}
</table></div>
{% endif %}
Note what appears to be a python object repr in the th tag.
Please let me know if you need any more information.
Attachments (3)
Change History (7)
by , 18 years ago
comment:1 by , 18 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 18 years ago
I've experienced the same by doing the Poll tutorial (Part 2, at the end of the page).
python manage.py adminindex polls
Output is:
{% if perms.polls %}
<div class="module"><h2>Polls</h2><table>
{% if perms.polls.add_poll or perms.polls.change_poll %}
<tr>
<th>{% if perms.polls.change_poll %}<a href="polls/poll/">{% endif %}<django.utils.functional.__proxy__ object at 0x10716b0>{% if perms.polls.change_poll %}</a>{% endif %}</th>
<td class="x50">{% if perms.polls.add_poll %}<a href="polls/poll/add/" class="addlink">{% endif %}Add{% if perms.polls.add_poll %}</a>{% endif %}</td>
<td class="x75">{% if perms.polls.change_poll %}<a href="polls/poll/" class="changelink">{% endif %}Change{% if perms.polls.change_poll %}</a>{% endif %}</td>
</tr>
{% endif %}
{% if perms.polls.add_choice or perms.polls.change_choice %}
<tr>
<th>{% if perms.polls.change_choice %}<a href="polls/choice/">{% endif %}<django.utils.functional.__proxy__ object at 0x1425d90>{% if perms.polls.change_choice %}</a>{% endif %}</th>
<td class="x50">{% if perms.polls.add_choice %}<a href="polls/choice/add/" class="addlink">{% endif %}Add{% if perms.polls.add_choice %}</a>{% endif %}</td>
<td class="x75">{% if perms.polls.change_choice %}<a href="polls/choice/" class="changelink">{% endif %}Change{% if perms.polls.change_choice %}</a>{% endif %}</td>
</tr>
{% endif %}
</table></div>
{% endif %}
comment:3 by , 18 years ago
| Has patch: | set |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
Force_unicode applied to lazy element.
comment:4 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Good catch!