Exemple #1
0
            .select_related('user', 'user__profile').order_by('-submit_date'),
    'template_object_list_name': 'comment',
}

profile_invites_info = {
    'paginate_by': None,
    'template_name': 'profiles/profile_detail_invites.html',
    'related_field': 'from_user__profile',
    'list_queryset': InvitationKey.objects.exclude(registrant=None).select_related().order_by('-date_invited'),
    'template_object_list_name': 'invite',
}

profile_update_info = {
    'form_class': PartialProfileForm,
    'login_required': True,
    'post_save_redirect': reverse_lazy('profiles:update_profile'),
    'template_name': 'profiles/profile_form.html',
    'current_user': True,
}

avatar_update_info = {
    'form_class': AvatarForm,
    'login_required': True,
    'post_save_redirect': reverse_lazy('profiles:update_avatar'),
    'template_name': 'profiles/avatar_form.html',
    'current_user': True,
}

password_change_info = {
    'template_name': 'profiles/password_change_form.html',
    'post_change_redirect': reverse_lazy('profiles:change_password_done'),
Exemple #2
0
Example URLConf for a contact form.

Because the ``contact_form`` view takes configurable arguments, it's
recommended that you manually place it somewhere in your URL
configuration with the arguments you want. If you just prefer the
default, however, you can hang this URLConf somewhere in your URL
hierarchy (for best results with the defaults, include it under
``/contact/``).

"""


from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template

from k2.utils.django.core.urlresolvers import reverse_lazy

from k2.contact.views import contact_form


urlpatterns = patterns('',
                       url(r'^$',
                           contact_form,
                           { 'success_url': reverse_lazy('contact:contact_form')},
                           name='contact_form'),
                       url(r'^sent/$',
                           direct_to_template,
                           { 'template': 'contact/form_sent.html' },
                           name='contact_form_sent'),
                       )