Commits

Tim Savage committed 7efb74c

Added documentation of contrib.auth.shortcuts. Updated .ignore files

Comments (0)

Files changed (3)

+# Unix cruft
 *~
+
+# Python cruft
 *.py[co]
 *.egg-info
-build*
-docs/*.html
 
 # IDE cruft
 .idea/*
+atlassian-ide-plugin.xml
+
+# Project artifacts
+build*
+dist*
+docs/*.html
+MANIFEST
 syntax: glob
+# Unix cruft
 *~
+
+# Python cruft
 *.py[co]
 *.egg-info
-build*
-docs/*.html
 
 # IDE cruft
 .idea/*
+atlassian-ide-plugin.xml
+
+# Project artifacts
+build*
+dist*
+docs/*.html
+MANIFEST

docs/topics/auth.txt

     It is not possible to use the `include_staff` and `include_superuser`
     parameters along when passing a sequence for the `user` parameter. A
     :exe:`TypeError` exception will be raised in this case.
+
+
+Shortcuts
+=========
+
+.. currentmodule:: django_extras.contrib.auth.shortcuts
+
+.. function:: get_owned_object_or_40x([klass, owner, include_staff=False, include_superuser=False, *args, **kwargs])
+
+A convenience method that follows on from the Django shortcut `get_object_or_404`.
+If the object cannot be loaded an :class:`Http404` exception is raised if an
+object is loaded but the owner is not valid a :class:`PermissionDenied`
+exception is raised.
+
+Is with the other extensions `include_staff` and `include_superuser` flags are
+provided. `*args` and `**kwargs` work in the same way as `get_object_or_404`.