Permalink
Browse files

Adding profile list and bumping the version

  • Loading branch information...
pydanny committed Sep 5, 2012
1 parent 4745faf commit f274eda453aebe4ffc5cdf116baac3148c06ecc5
Showing with 33 additions and 4 deletions.
  1. +2 −0 CHANGELOG
  2. +1 −1 README.rst
  3. +1 −1 docs/conf.py
  4. +1 −1 profiletools/__init__.py
  5. +7 −0 profiletools/middleware.py
  6. +21 −1 profiletools/views.py
View
@@ -2,6 +2,8 @@
CHANGELOG
=========
+# 0.2.1 Profile list views
+
# 0.2.0 Added in some default views and a form.
# 0.1.3 Fixed problem with profile model name differences between projects
View
@@ -2,7 +2,7 @@
django-profiletools
===================
:Info: Tools for Profile models in Django.
-:Version: 0.2.0
+:Version: 0.2.1
:Author: Daniel Greenfeld (http://pydanny.com)
Features
View
@@ -50,7 +50,7 @@
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
-release = '0.2.0'
+release = '0.2.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
View
@@ -1,6 +1,6 @@
__author__ = 'Daniel Greenfeld'
-VERSION = (0, 2, 0)
+VERSION = (0, 2, 1)
def get_version():
@@ -16,3 +16,10 @@ def process_request(self, request):
setattr(request.__class__,
my_profile_module_name,
SimpleLazyObject(lambda: get_profile(request.user)))
+
+
+ from django.core.urlresolvers import reverse
+ from django.http import HttpResponseRedirect
+ from django.contrib import messages
+
+
View
@@ -1,4 +1,4 @@
-from django.views.generic import DetailView, UpdateView
+from django.views.generic import DetailView, UpdateView, ListView
from braces.views import LoginRequiredMixin
@@ -62,3 +62,23 @@ def get_object(self):
user=self.request.user
)
return profile
+
+
+class ProfileListView(ListView):
+ """ Called thus::
+
+ url(regex=r'^$',
+ view=views.ProfileListView.as_view(),
+ name='profile_list'),
+ """
+ model = PROFILE_MODEL
+
+
+class LoginRequireProfileListView(LoginRequiredMixin, ListView):
+ """ Called thus::
+
+ url(regex=r'^$',
+ view=views.LoginRequireProfileListView.as_view(),
+ name='profile_list'),
+ """
+ model = PROFILE_MODEL

0 comments on commit f274eda

Please sign in to comment.