.. _ref-basic_profiles-reference: ========= 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 ----------------------------- An AJAX call back URL to the ``pinax.apps.autocomplete_app.views.username_autocomplete_friends`` app that looks up and provides a list of data to the jQuery autocomplete_ plugin. See :ref:`autocomplete app usage documentation `. 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: .. code-block:: html Show "beth" Users 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[\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`` ----------------------------------- .. automodule:: pinax.apps.basic_profiles.admin :members: :undoc-members: ``pinax.apps.basic_profiles.forms`` ----------------------------------- .. automodule:: pinax.apps.basic_profiles.forms :members: :undoc-members: ``pinax.apps.basic_profiles.management.commands.create_profiles_for_users`` --------------------------------------------------------------------------- .. automodule:: pinax.apps.basic_profiles.management.commands.create_profiles_for_users :members: :undoc-members: ``pinax.apps.basic_profiles.models`` ------------------------------------ .. automodule:: pinax.apps.basic_profiles.models :members: :undoc-members: ``pinax.apps.basic_profiles.templatetags.basic_profile_tags`` ------------------------------------------------------------- .. automodule:: pinax.apps.basic_profiles.templatetags.basic_profile_tags :members: :undoc-members: ``pinax.apps.basic_profiles.views`` ----------------------------------- .. automodule:: pinax.apps.basic_profiles.views :members: :undoc-members: .. _autocomplete: http://docs.jquery.com/Plugins/Autocomplete