Django

Code

Ticket #2048 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] Allow positional args in get_object_or_404

Reported by: Joeboy Assigned to: adrian
Milestone: Component: Core framework
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

positional-args-in-get-object-or-404.diff (0.6 kB) - added by Joeboy on 05/31/06 07:05:40.

Change History

05/31/06 07:05:40 changed by Joeboy

  • attachment positional-args-in-get-object-or-404.diff added.

05/31/06 07:34:06 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

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

05/31/06 07:36:02 changed by jacob

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


Add/Change #2048 ([patch] Allow positional args in get_object_or_404)




Change Properties
Action