#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)
Change History (3)
by , 18 years ago
Attachment: | positional-args-in-get-object-or-404.diff added |
---|
comment:1 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [3014]) Fixed #2048 - get_object_or_404 now allows *args as well. Thanks, Joeboy