简体   繁体   中英

getting the full UserProfile profile

I am doing this through django

$ python manage.py shell
from django.contrib.auth.models import User
a = User(username='zoro')
a.get_profile().?

what do i type after get_profile . to get the full profile instead of typing in one thing like a.get_profile().Location to get just the location.

a.get_profile() is the full profile (its an instance object of your user profile model). So you can save it in a variable and and use it.

Though if you want to get everything as a python dict you could try a.get_profile().__dict__ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM