How can I add avatar and hidden field to django idios

Go To StackoverFlow.com

2

I'm using pinax, and using the idios which is the default profile apps for user profile. However, I don't know how to add my own logic. I know I can customize my own model, but the document seems too naive for me. Is there any method to extend idios, for example I want to add a hidden field in module, but I don't know how to change its value when submit the form. Also how can I add gravatar to idios?

Thank you.

2012-04-05 02:40
by Xinghan


0

Since Pinax is just a Django based project so you just inherit from idios.ProfileBase model and override AUTH_PROFILE_MODULE in settings file with your own profile model

Your profile with avatar

class ProfileWithAvatar(ProfileBase):
    """ Profile model with user avatar """
    avatar = models.ImageField(upload_to="uploads/")
    # and add fields whatever you want

settings.py

...
AUTH_PROFILE_MODULE = 'MyApp.ProfileWithAvatar'
...

Enjoy, hope this will help for you.

Sultan,

Thanks

2012-08-27 13:25
by sultan
Ads