# Path: startup/accounts/views.py
# class DetailUser(DetailView):
#     model = User
# 
#     def get_object(self, queryset=None):
#         return self.request.user
# 
# class UpdateUser(UpdateView):
#     model = User
#     form_class = UserUpdateForm
# 
#     def get_object(self, queryset=None):
#         return self.request.user
# 
# class CreateUser(CreateView):
#     model = User
#     form_class = UserCreationForm


from django.conf.urls import patterns, url, include
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView
from startup.accounts.views import DetailUser, UpdateUser, CreateUser
# coding=utf-8



urlpatterns = patterns(
    '',
    url(r'^$', login_required(RedirectView.as_view(url=reverse_lazy('account_detail'), permanent=False))),
    url(r'^create/$', CreateUser.as_view(), name='account_create'),
    url(r'^detail/$', login_required(DetailUser.as_view()), name='account_detail'),

# Path: startup/accounts/views.py
# class DetailUser(DetailView):
#     model = User
# 
#     def get_object(self, queryset=None):
#         return self.request.user
# 
# class UpdateUser(UpdateView):
#     model = User
#     form_class = UserUpdateForm
# 
#     def get_object(self, queryset=None):
#         return self.request.user
# 
# class CreateUser(CreateView):
#     model = User
#     form_class = UserCreationForm


# Path: startup/accounts/urls.py
from django.conf.urls import patterns, url, include
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView
from startup.accounts.views import DetailUser, UpdateUser, CreateUser

# coding=utf-8



urlpatterns = patterns(
    '',
    url(r'^$', login_required(RedirectView.as_view(url=reverse_lazy('account_detail'), permanent=False))),
    url(r'^create/$', CreateUser.as_view(), name='account_create'),
    url(r'^detail/$', login_required(DetailUser.as_view()), name='account_detail'),

    url(r'^update/$', login_required(UpdateUser.as_view()), name='account_update'),