from django contrib auth models import User user User objects all fiel

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
>>> from django.contrib.auth.models import User
>>> user = User.objects.all()[0]
>>> field_names = [f.name for f in user._meta.fields]
>>> for field_name in field_names:
... print '%s: %s' % (field_name, getattr(user, field_name))
...
id: 1
username: lorien
first_name:
last_name:
email: lizendir@gmail.com
password: sha1$**********************************
is_staff: 0
is_active: 1
is_superuser: 0
last_login: 2007-09-16 08:16:58
date_joined: 2007-09-16 08:14:41