Sphene Community Tools


Copyright © 2007-2018 by Herbert Poul

You are not logged in.

Change Language:

AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Feature Discussions » Adding to profiles from another application

Hey, what's the best way to manipulate the user profiles from another app? We need to insert existing information from the old site (avatar, signature) but some of the fields in your profile, like signature, seem to be added as custom fields. So we have to look up the field, then get the data for that field?
"Never quote yourself" -- Daniel Ellison
this should be quite easy .. for the avatar create a new
sphene.community.models.\CommunityUserProfile instance.. it simply links the django user ..
for the signature you need
sphene.community.sphboard.\BoardUserProfile .. which also links the django user.

any other field (like IM contacts or similar) get a bit more complicated though.. for each type of field, you need to create a \CommunityUserProfileField which describes the type of field and what values are allowed.. afterwards you can add for each user the \CommunityUserProfileFieldValue which holds a reference to the \CommunityUserProfile, and to the type of field .. and of course the value itself..

if you need any special or more complicated fields you can also extend the profile system (see Community/UserProfiles which should help a bit) - exactly this system is used by the board to provide the Signature functionality .. so you could take this as an example..
Hey, we have Signatures !!! Great, isn't it ? ;)

Please login to post a reply.

Powered by Sphene Community Tools