mszamot avatar mszamot committed df2a8e1 Merge

Merged changed from the upstream branch

Comments (0)

Files changed (9)

 e263c551ef7be3d99813effdc7a4f22041539f83 v0.6
 d073602dc103edfae55419b043af1f4b6a58e1e5 v0.7
 2d6fcc0c55d0c63d5e506b59e32cad9329963509 v0.8
+c5f81c8e59e8de4db7bc284b2a06ef93c0194ff1 v1.0
+c5f81c8e59e8de4db7bc284b2a06ef93c0194ff1 v1.0
+0000000000000000000000000000000000000000 v1.0
+0000000000000000000000000000000000000000 v1.0
+602c6c52b13585ffd7390a327106ba3231dc936f v1.0
+602c6c52b13585ffd7390a327106ba3231dc936f v1.0
+0000000000000000000000000000000000000000 v1.0
+0000000000000000000000000000000000000000 v1.0
+aafb10048c77a80d93526ae4f2c2ce648399ee8b v1.0
-========================
-Django user registration
-========================
+.. -*-restructuredtext-*-
 
 This is a fairly simple user-registration application for Django,
 designed to make allowing user signups as painless as possible. It
 For installation instructions, see the file "INSTALL" in this
 directory; for instructions on how to use this application, and on
 what it provides, see the file "quickstart.rst" in the "docs/"
-directory.
+directory. Full documentation is also `available online
+https://django-registration.readthedocs.org/`_
 
 # General information about the project.
 project = u'django-registration'
-copyright = u'2007-2012, James Bennett'
+copyright = u'2007-2013, James Bennett'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
 # The short X.Y version.
-version = '0.9'
+version = '1.0'
 # The full version, including alpha/beta/rc tags.
-release = '0.9'
+release = '1.0'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-django-registration 0.8 documentation
-=====================================
+django-registration |version| documentation
+===========================================
 
 This documentation covers the |version| release of
 django-registration, a simple but extensible application providing
    quickstart
    release-notes
    upgrade
-   api
    default-backend
    simple-backend
    forms
 Backwards-incompatible changes
 ------------------------------
 
-If you're upgrading from an older release of django-registration, and
-if you were using the default setup (i.e., the included default
-URLconf and no custom URL patterns or custom arguments to views), you
-do not need to make any chances.
+The entire codebase was rewritten for |version|, switching from
+function-based views accepting keyword arguments to class-based views
+with overridable attributes. Whether this affects you will depend on
+how you were using django-registration previously:
 
-If you had customized django-registration by writing your own backend,
-you will now need to implement that backend by subclassing :ref:`the
-built-in views <views>` and overriding or implementing your
-customizations appropriately. Much of this is similar to previous
-backend class implementations, so minimal changes to existing code
-should be required.
+* If you're upgrading from an older release of django-registration,
+  and if you were using the default setup (i.e., the included default
+  URLconf and no custom URL patterns or custom arguments to views),
+  you do not need to make any changes.
+
+* If you had customized django-registration by writing your own
+  backend, you will now need to implement that backend by subclassing
+  :ref:`the built-in views <views>` and overriding or implementing
+  your customizations appropriately. Much of this is similar to
+  previous backend class implementations, so minimal changes to
+  existing code should be required; the primary change is that the
+  backend classes now *are* the views, so if you had multiple views
+  (e.g., one for signup and one for activation) your backend will now
+  consist of multiple classes -- one class per view -- rather than one
+  class total.

registration/__init__.py

-VERSION = (0, 9, 0, 'beta', 1)
+VERSION = (1, 0, 0, 'final', 0)
 
 
 def get_version():
+    "Returns a PEP 386-compliant version number from VERSION."
+    assert len(VERSION) == 5
+    assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
+
+    # Now build the two parts of the version number:
+    # main = X.Y[.Z]
+    # sub = .devN - for pre-alpha releases
+    #     | {a|b|c}N - for alpha, beta and rc releases
+
+    parts = 2 if VERSION[2] == 0 else 3
+    main = '.'.join(str(x) for x in VERSION[:parts])
+
+    sub = ''
+    if VERSION[3] != 'final':
+        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
+        sub = mapping[VERSION[3]] + str(VERSION[4])
     from django import get_version as django_get_version
     return django_get_version(VERSION) # pragma: no cover

registration/models.py

 from django.utils.translation import ugettext_lazy as _
 
 try:
+    from django.contrib.auth import get_user_model
+    User = get_user_model()
+except ImportError:
+    from django.contrib.auth.models import User
+
+try:
     from django.utils.timezone import now as datetime_now
 except ImportError:
     datetime_now = datetime.datetime.now

registration/tests/default_backend.py

 
         self.assertEqual(200, resp.status_code)
         self.assertTemplateUsed(resp, 'registration/activate.html')
-        self.assertEqual(profile.activation_key,
-                         resp.context['activation_key'])
+        self.failIf('activation_key' in resp.context)
       description='An extensible user-registration application for Django',
       author='James Bennett',
       author_email='james@b-list.org',
-      url='http://www.bitbucket.org/ubernostrum/django-registration/wiki/',
-      download_url='http://www.bitbucket.org/ubernostrum/django-registration/get/v0.8.gz',
+      url='http://www.bitbucket.org/ubernostrum/django-registration/',
+      download_url='https://bitbucket.org/ubernostrum/django-registration/downloads/django-registration-1.0.tar.gz',
       package_dir={'registration': 'registration'},
       packages=packages,
       package_data={'registration': data_files},
-      classifiers=['Development Status :: 4 - Beta',
+      classifiers=['Development Status :: 5 - Production/Stable',
                    'Environment :: Web Environment',
                    'Framework :: Django',
                    'Intended Audience :: Developers',
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.