Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#2048 closed enhancement (fixed)

[patch] Allow positional args in get_object_or_404

Reported by: Joeboy Owned by: adrian
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 10 years ago.

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by Joeboy

comment:1 Changed 10 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:2 Changed 10 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