Edgewall Software

Opened 7 years ago

Last modified 4 years ago

#12684 closed enhancement

_RequestArgs.get should alias getfirst — at Version 1

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: 1.3.2
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

Discussed in #12682, to make the API more pythonic and to fix issues like the one seen in #12682, req.args.get should return a string rather than a string or list. If a list is expected req.args.getlist should be used.

_RequestArgs.getbinary will be added, as a shorthand for: req.args.getint('key', default, min=0, max=1).

The as_ methods of _RequestArgs should be modified/extended to be consistent with the changes.

Code in query.py can also be refactored to use _RequestArgs: trunk/trac/ticket/query.py@15573:949-971#L948.

Change History (1)

comment:1 by Ryan J Ollos, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.