Skip to content

Instantly share code, notes, and snippets.

@spenoir
spenoir / profile_views.py
Created May 23, 2012 11:31
This is a base CBV that utilises django-activity-stream and Towel to enable user profile following. Towel makes it easy to specify one class that handles all the CRUD operations required for profile viewing and editing.
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from towel.modelview import ModelView
from actstream.models import Follow
from models import MyModel
from forms import UserProfileRegistrationForm, UserRoleSearchForm
class BaseProfileView(ModelView):
"""