| - Renderstring: A python formatting string how the | | - Renderstring: A python formatting string how the |
| value should be rendered. You can use %(value)s t | | value should be rendered. You can use %(value)s t |
| o include the value. | | o include the value. |
| - Sortorder: Defines the order in which the fields | | - Sortorder: Defines the order in which the fields |
| appear while editing or viewing a user profile. | | appear while editing or viewing a user profile. |
| | | |
| | | |
| # Taking advantage of user profiles in your own ap | | # Taking advantage of user profiles in your own ap |
| plications | | plications |
t | | t |
|
| | | The user profiles are ment to be as extensible as |
| | | possible. To achieve this, at specific places whil |
| | | e editing or displaying the profile signals are di |
| | | spatched which can be intercepted by any django ap |
| | | plication to modify the resulting output.
|
| | |
|
| | | Three signals are currently defined (all under sph |
| | | ene.community.signals)
|
| | | - profile_edit_init_form: dispatched after initiat |
| | | ing the form (django newforms). Allows application |
| | | s to add additional fields.
|
| | | - profile_edit_save_form: Called after the basic u |
| | | ser information has been saved and further profile |
| | | information can be retrieved and saved. (In this |
| | | stage the form was already validated)
|
| | | - profile_display: dispatched whenever a profile i |
| | | s displayed. signal handlers can return a string w |
| | | hich will be added to the HTML input inside a two- |
| | | column table tag.
|
| | |
|
| | | I hope you now at least have grasp what could be d |
| | | one currently. Since I'm not sure how useful this |
| | | can be I'm not extensively documenting this part. |
| | | If you think this can be useful for you check for |
| | | example how sphboard uses these signals (sphenecol |
| | | l/sphene/sphboard/models.py), post in the board or |
| | | write me (herbert.poul@gmail.com) an email.
|
| | |
|
| | | # Disabling profiles
|
| | |
|
| | | If you want to disable the user profiles for some |
| | | reason (e.g. because you have your own user profil |
| | | e mechanism) - it shouldn't be too hard to accompl |
| | | ish this.
|
| | |
|
| | | The most important thing to do is overload the tem |
| | | plate sphene/community/_display_username.html whic |
| | | h is used throughout SCT to display the full usern |
| | | ame including a link the the user profile. You can |
| | | adopt the template to link to your profile implem |
| | | entation.
|