Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2048 closed enhancement (fixed)

[patch] Allow positional args in get_object_or_404

Reported by: Joeboy Owned by: Adrian Holovaty
Component: Core (Other) Version: master
Severity: minor Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


presently, get_object_or_404 only accepts keyword arguments, so this kind of query:

r = get_object_or_404( Resource, Q(pk=resource_id) & (Q(expiry_date__isnull=True) | Q( )

fails. Patch appears to fix it. (thanks for Heimy for irc assistance).

Attachments (1)

positional-args-in-get-object-or-404.diff (626 bytes) - added by Joeboy 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by Joeboy

comment:1 Changed 12 years ago by Jacob

Resolution: fixed
Status: newclosed

(In [3014]) Fixed #2048 - get_object_or_404 now allows *args as well. Thanks, Joeboy

comment:2 Changed 12 years ago by Jacob

(In [3015]) Added *args to get_list_or_404, too (refs #2048).

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