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.

4

1 回答 1

0

由于 Pinax 只是一个基于 Django 的项目,因此您只需从idios.ProfileBase模型继承并使用您自己的配置文件模型覆盖设置文件中的 AUTH_PROFILE_MODULE

您带有头像的个人资料

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

设置.py

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

享受,希望这对你有帮助。

苏丹,

谢谢

于 2012-08-27T13:25:49.757 回答