Opened 18 years ago

Closed 18 years ago

Last modified 18 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: dev
Severity: minor Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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(expiry_date__gt=datetime.now())) )

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 18 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by Jacob, 18 years ago

Resolution: fixed
Status: newclosed

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

comment:2 by Jacob, 18 years ago

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

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