grate.djangocompat

Django compatibility helper.

class grate.djangocompat.DjangoUser(**values)

Implements a Django User object (i.e. django.contrib.auth.models.User).

exception DoesNotExist
exception DjangoUser.MultipleObjectsReturned
DjangoUser.check_password(raw_password)
Parameters:raw_password – The raw password.
Returns:True if the given raw password matches.
classmethod DjangoUser.create_user(username, password, email=None)
Parameters:
  • username – The username.
  • password – The raw password.
  • email – The email address.
Returns:

The User.

DjangoUser.date_joined

A datetime field.

DjangoUser.email

A unicode string field.

DjangoUser.first_name

A unicode string field.

DjangoUser.get_full_name()
Returns:The full name of this user.
Return type:str
DjangoUser.has_unusable_password()
Returns:True if this user’s password cannot be used for authentication.
DjangoUser.is_active

A boolean field type.

New in version 0.1.2.

DjangoUser.is_anonymous()
Returns:False
Return type:bool
DjangoUser.is_authenticated()
Returns:True
Return type:bool
DjangoUser.is_staff

A boolean field type.

New in version 0.1.2.

DjangoUser.is_superuser

A boolean field type.

New in version 0.1.2.

DjangoUser.last_login

A datetime field.

DjangoUser.last_name

A unicode string field.

DjangoUser.password

A unicode string field.

DjangoUser.set_password(raw_password)

Changes the user’s password by storing the crypt(2) version. :param raw_password: The raw password.

DjangoUser.set_unusable_password()

Marks this user’s password as invalid.

DjangoUser.username

A unicode string field.

Previous topic

grate.atomic

Next topic

grate.init

This Page