Reference

This document covers various components of pinax.apps.basic_profiles.

Named Urls

The named urls in this app should enable the use of of the {% url %} template tag as well as reverse lookups in your project code without having to know the implementation details of this app.

profile_username_autocomplete

Provides a call back url that uses the pinax.apps.autocomplete_app views to provide data back to the jQuery autocomplete plugin.

profile_list

Upon GET request, this url will render a template named basic_profiles/profiles.html by default with a list of users in context ordered by either date_joined descending or by username ascending. This is further optionally limited with case-insensitive search against the username field if the query parameter search_terms is provided. Likewise, the ordering defaults to date_joined descending which can be overridden by supplying the query parameter order with the value of name.

Examples:

<a href="{% url profile_list %}?search_terms=beth&order=name">Show "beth" Users</a>

This would result in the users context variable limited to users such as Beth, Bethany, Marybeth and would be ordered alphabetically by their username.

The value of order and search_terms are also passed to the template as context variables.

profile_detail

This url will render a template named basic_profiles/profile.html by default with is_me and other_user as context variables where is_me is a boolean that indicates whether or not other_user is the same as the authenticated user making the request.

keyword arguments:
 The username for the profile to view that matches (?P<username>[\w\._-]+)

profile_edit

This url, when POSTed to will process the variables through a pinax.apps.basic_profiles.forms.ProfileForm instance, otherwise it will process a GET request by rendering basic_profiles/profile_edit.html by default for regular requests and basic_profiles/profile_edit_facebox.html for ajax calls. It renders both of these templates with an instance of the pinax.apps.basic_profiles.ProfileForm as profile_form and an instance of pinax.apps.basic_profiles.models.Profile as profile.

Templates

Templates should be placed in an basic_profiles/ folder at the root of one of your template search paths.

profiles.html

context:users, order, search_terms

profile.html

context:is_me, other_user

profile_edit.html

context:profile, profile_form

profile_edit_facebox.html

context:profile, profile_form

Modules

pinax.apps.basic_profiles.admin

pinax.apps.basic_profiles.forms

class pinax.apps.basic_profiles.forms.ProfileForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None)
class Meta
model
alias of Profile
ProfileForm.media

pinax.apps.basic_profiles.management.commands.create_profiles_for_users

class pinax.apps.basic_profiles.management.commands.create_profiles_for_users.Command
handle_noargs(**options)

pinax.apps.basic_profiles.models

class pinax.apps.basic_profiles.models.Profile(*args, **kwargs)

Profile(id, user_id, name, about, location, website)

exception DoesNotExist
exception Profile.MultipleObjectsReturned
Profile.get_absolute_url(*moreargs, **morekwargs)
Profile.user
pinax.apps.basic_profiles.models.create_profile(sender, instance=None, **kwargs)

pinax.apps.basic_profiles.templatetags.basic_profile_tags

pinax.apps.basic_profiles.templatetags.basic_profile_tags.clear_search_url(request)
pinax.apps.basic_profiles.templatetags.basic_profile_tags.show_profile(user)

pinax.apps.basic_profiles.views

pinax.apps.basic_profiles.views.profile(request, username, template_name='basic_profiles/profile.html')
pinax.apps.basic_profiles.views.profile_edit(request, *args, **kwargs)
pinax.apps.basic_profiles.views.profiles(request, template_name='basic_profiles/profiles.html')