Opened 15 years ago

Closed 10 years ago

#12098 closed New feature (fixed)

HttpRequest __repr__ too verbose

Reported by: Cody Soyland <codysoyland@…> Owned by: Berker Peksag
Component: HTTP handling Version: dev
Severity: Normal Keywords:
Cc: codysoyland@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When working from a shell, printing request always fills my terminal with unneeded information. I would like to type locals() within a view without garbage all over my screen and type request.META, request.POST, etc if I would like to see more details. My patch replaces GET, POST, COOKIES, and META with the method and URL.

Attachments (3)

requestrepr.diff (3.3 KB ) - added by Cody Soyland <codysoyland@…> 15 years ago.
Replaces output of request.repr with the method and URL
requestrepr.2.diff (5.5 KB ) - added by Cody Soyland <codysoyland@…> 15 years ago.
This patch does handles parse errors in get_full_path and adds request metadata to error emails.
requestrepr.3.diff (5.5 KB ) - added by Cody Soyland <codysoyland@…> 15 years ago.
The only difference from the last patch is that this one uses an unqualified exception catcher.

Download all attachments as: .zip

Change History (12)

by Cody Soyland <codysoyland@…>, 15 years ago

Attachment: requestrepr.diff added

Replaces output of request.repr with the method and URL

comment:1 by Cody Soyland <codysoyland@…>, 15 years ago

Cc: codysoyland@… added
Needs tests: set

by Cody Soyland <codysoyland@…>, 15 years ago

Attachment: requestrepr.2.diff added

This patch does handles parse errors in get_full_path and adds request metadata to error emails.

comment:2 by Cody Soyland <codysoyland@…>, 15 years ago

This is probably ready for check-in now.

by Cody Soyland <codysoyland@…>, 15 years ago

Attachment: requestrepr.3.diff added

The only difference from the last patch is that this one uses an unqualified exception catcher.

comment:3 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Julien Phalip, 14 years ago

Severity: Normal
Type: New feature

comment:5 by Thejaswi Puthraya, 13 years ago

Component: UncategorizedHTTP handling
Easy pickings: unset
UI/UX: unset

comment:6 by Luke Plant, 13 years ago

See also #16178, which logically should go in first.

comment:7 by Berker Peksag, 10 years ago

Needs tests: unset
Owner: changed from nobody to Berker Peksag
Status: newassigned
Version: 1.1master

comment:8 by Claude Paroz, 10 years ago

Triage Stage: AcceptedReady for checkin

Looks good!

comment:9 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.
Back to Top