django :: contrib :: auth :: models :: User :: Class User
[hide private]
[frames] | no frames]

Class User


Users within the Django authentication system are represented by this model.

Username and password are required. Other fields are optional.

Nested Classes [hide private]
  DoesNotExist
  MultipleObjectsReturned

Inherited from db.models.base.Model: __metaclass__

Instance Methods [hide private]
 
__unicode__(self)
 
_base_manager(...)
 
_get_message_set(self)
 
check_password(self, raw_password)
Returns a boolean of whether the raw_password was correct.
 
email_user(self, subject, message, from_email=None)
Sends an e-mail to this User.
 
get_absolute_url(*moreargs, **morekwargs)
 
get_all_permissions(self, obj=None)
 
get_and_delete_messages(self)
 
get_full_name(self)
Returns the first_name plus the last_name, with a space in between.
 
get_group_permissions(self, obj=None)
Returns a list of permission strings that this user has through his/her groups.
 
get_next_by_date_joined(*moreargs, **morekwargs)
 
get_next_by_last_login(*moreargs, **morekwargs)
 
get_previous_by_date_joined(*moreargs, **morekwargs)
 
get_previous_by_last_login(*moreargs, **morekwargs)
 
get_profile(self)
Returns site-specific profile for this user.
 
has_module_perms(self, app_label)
Returns True if the user has any permissions in the given app label.
 
has_perm(self, perm, obj=None)
Returns True if the user has the specified permission.
 
has_perms(self, perm_list, obj=None)
Returns True if the user has each of the specified permissions.
 
has_usable_password(self)
 
is_anonymous(self)
Always returns False.
 
is_authenticated(self)
Always return True.
 
objects(...)
 
set_password(self, raw_password)
 
set_unusable_password(self)

Inherited from db.models.base.Model: __eq__, __hash__, __init__, __ne__, __reduce__, __repr__, __str__, clean, clean_fields, date_error_message, delete, full_clean, prepare_database_save, save, save_base, serializable_value, unique_error_message, validate_unique

Inherited from db.models.base.Model (private): _collect_sub_objects, _get_FIELD_display, _get_next_or_previous_by_FIELD, _get_next_or_previous_in_order, _get_pk_val, _get_unique_checks, _perform_date_checks, _perform_unique_checks, _set_pk_val

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  _default_manager = <django.contrib.auth.models.UserManager obj...
  _message_set = <django.db.models.fields.related.ForeignRelated...
  _meta = <Options for User>
  groups = <django.db.models.fields.related.ReverseManyRelatedOb...
  logentry_set = <django.db.models.fields.related.ForeignRelated...
  messages = <django.db.models.fields.related.ManyRelatedObjects...
  owned_slices = <django.db.models.fields.related.ForeignRelated...
  received_permission_requests = <django.db.models.fields.relate...
  registrationprofile_set = <django.db.models.fields.related.For...
  role_requests_made = <django.db.models.fields.related.ForeignR...
  role_requests_received = <django.db.models.fields.related.Fore...
  sent_messages = <django.db.models.fields.related.ForeignRelate...
  sent_permission_requests = <django.db.models.fields.related.Fo...
  user_permissions = <django.db.models.fields.related.ReverseMan...
  userprofile_set = <django.db.models.fields.related.ForeignRela...

Inherited from db.models.base.Model (private): _deferred

Properties [hide private]
  message_set

Inherited from db.models.base.Model: pk

Inherited from object: __class__

Method Details [hide private]

check_password(self, raw_password)

 

Returns a boolean of whether the raw_password was correct. Handles encryption formats behind the scenes.

get_group_permissions(self, obj=None)

 

Returns a list of permission strings that this user has through his/her groups. This method queries all available auth backends. If an object is passed in, only permissions matching this object are returned.

get_profile(self)

 

Returns site-specific profile for this user. Raises SiteProfileNotAvailable if this site does not allow profiles.

has_module_perms(self, app_label)

 

Returns True if the user has any permissions in the given app label. Uses pretty much the same logic as has_perm, above.

has_perm(self, perm, obj=None)

 

Returns True if the user has the specified permission. This method queries all available auth backends, but returns immediately if any backend returns True. Thus, a user who has permission from a single auth backend is assumed to have permission in general. If an object is provided, permissions for this specific object are checked.

has_perms(self, perm_list, obj=None)

 

Returns True if the user has each of the specified permissions. If object is passed, it checks if the user has all required perms for this object.

is_anonymous(self)

 

Always returns False. This is a way of comparing User objects to anonymous users.

is_authenticated(self)

 

Always return True. This is a way to tell if the user has been authenticated in templates.


Class Variable Details [hide private]

_default_manager

Value:
<django.contrib.auth.models.UserManager object at 0x8c22c4c>

_message_set

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8c2c58c>

groups

Value:
<django.db.models.fields.related.ReverseManyRelatedObjectsDescriptor o\
bject at 0x8c2c20c>

logentry_set

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8c91a0c>

messages

Value:
<django.db.models.fields.related.ManyRelatedObjectsDescriptor object a\
t 0x8c8790c>

owned_slices

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8d7ed0c>

received_permission_requests

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8c6686c>

registrationprofile_set

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8c978ac>

role_requests_made

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8d74f0c>

role_requests_received

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8d74f8c>

sent_messages

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8c87e4c>

sent_permission_requests

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8c667ac>

user_permissions

Value:
<django.db.models.fields.related.ReverseManyRelatedObjectsDescriptor o\
bject at 0x8c27b2c>

userprofile_set

Value:
<django.db.models.fields.related.ForeignRelatedObjectsDescriptor objec\
t at 0x8d89b4c>

Property Details [hide private]

message_set

Get Method:
_get_message_set(self)