Anonymous avatar Anonymous committed 225f59f

Update some docstrings, and add a couple module docstrings

Comments (0)

Files changed (2)

+"""
+URLConf for Django user profile management.
+
+Recommended usage is to use a call to ``include()`` in your project's
+root URLConf to include this URLConf for any URL beginning with
+'/profiles/'.
+
+"""
+
 from django.conf.urls.defaults import *
 
 from profiles import views

profiles/views.py

+"""
+Views for creating, editing and viewing site-specific user profiles.
+
+"""
+
 from django.core.exceptions import ObjectDoesNotExist
 from django.core.urlresolvers import reverse
 from django.http import Http404, HttpResponseRedirect
 from django.template import RequestContext
 
 from django.contrib.auth.decorators import login_required
-from django.contrib.auth.models import User, SiteProfileNotAvailable
+from django.contrib.auth.models import User
 
 from profiles.utils import get_profile_model
 
     """
     Create a profile for the user, if one doesn't already exist.
     
+    If the user already has a profile, as determined by
+    ``request.user.get_profile()``, a redirect will be issued to the
+    :view:`profiles.views.edit_profile` view. If no profile model has
+    been specified in the ``AUTH_PROFILE_MODULE`` setting,
+    ``django.contrib.auth.models.SiteProfileNotAvailable`` will be
+    raised.
+    
     To specify the form class used for profile creation, pass it as
     the keyword argument ``form_class``; if this is not supplied, it
     will fall back to ``form_for_model`` for the model specified in
-    the ``AUTH_PROFILE_MODULE`` setting (and will raise
-    ``SiteProfileNotAvailable`` if that setting is not specified or
-    does not correspond to an installed model.
+    the ``AUTH_PROFILE_MODULE`` setting.
     
     If you are supplying your own form class, it must define a method
     named ``save()`` which corresponds to the signature of ``save()``
     looking for a ``save_m2m()`` method on the form is used, and so
     your form class should define this method.
     
-    If the user already has a profile, as determined by
-    ``request.user.get_profile()``, a redirect will be issued to the
-    ``edit_profile()`` view.
-    
-    If no profile model has been specified in the
-    ``AUTH_PROFILE_MODULE`` setting,
-    ``django.contrib.auth.models.SiteProfileNotAvailable`` will be
-    raised.
-    
     To specify a URL to redirect to after successful profile creation,
     pass it as the keyword argument ``success_url``; this will default
-    to the URL of the ``profile_detail()`` view for the new profile if
-    unspecified.
+    to the URL of the :view:`profiles.views.profile_detail` view for
+    the new profile if unspecified.
     
     To specify the template to use, pass it as the keyword argument
     ``template_name``; this will default to
     """
     Edit a user's profile.
     
+    If the user does not already have a profile (as determined by
+    ``User.get_profile()``), a redirect will be issued to the
+    :view:`profiles.views.create_profile` view; if no profile model
+    has been specified in the ``AUTH_PROFILE_MODULE`` setting,
+    ``django.contrib.auth.models.SiteProfileNotAvailable`` will be
+    raised.
+    
     To specify the form class used for profile editing, pass it as the
     keyword argument ``form_class``; this form class must have a
     ``save()`` method which will save updates to the profile
     object. If not supplied, this will default to
     ``form_for_instance`` for the user's existing profile object.
     
-    If the user does not already have a profile (as determined by
-    ``User.get_profile()``), a redirect will be issued to the
-    ``create_profile()`` view; if no profile model has been specified
-    in the ``AUTH_PROFILE_MODULE`` setting,
-    ``django.contrib.auth.models.SiteProfileNotAvailable`` will be
-    raised.
-    
     To specify the URL to redirect to following a successful edit,
     pass it as the keyword argument ``success_url``; this will default
-    to the URL of the ``profile_detail()`` view if not supplied.
+    to the URL of the :view:`profiles.views.profile_detail` view if
+    not supplied.
     
     To specify the template to use, pass it as the keyword argument
     ``template_name``; this will default to
     Detail view of a user's profile.
     
     If no profile model has been specified in the
-    ``AUTH_PROFILE_MODULE`` setting, or if the user has not yet
-    created a profile, ``Http404`` will be raised.
+    ``AUTH_PROFILE_MODULE`` setting,
+    ``django.contrib.auth.models.SiteProfileNotAvailable`` will be
+    raised.
+
+    If the user has not yet created a profile, ``Http404`` will be
+    raised.
     
     To specify the template to use, pass it as the keyword argument
     ``template_name``; this will default to
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.