Models

PasswordChangeRequired

class password_policies.models.PasswordChangeRequired(*args, **kwargs)

Stores an entry to enforce password changes, related to auth.User.

Has the following fields:

created

DateTimeField (Automatically set when created)

The date the entry was created.

Parameters:
  • auto_now_add – True
  • blank – True
  • db_index – True
  • error_messages – {u’unique’: u’%(model_name)s with this %(field_label)s already exists.’, u’null’: u’This field cannot be null.’, u’invalid’: u”’%(value)s’ value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format.”, u’invalid_choice’: u’Value %(value)r is not a valid choice.’, u’invalid_date’: u”’%(value)s’ value has the correct format (YYYY-MM-DD) but it is an invalid date.”, u’blank’: u’This field cannot be blank.’, u’invalid_datetime’: u”’%(value)s’ value has the correct format (YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) but it is an invalid date/time.”, u’unique_for_date’: u’%(field_label)s must be unique for %(date_field_label)s %(lookup_type)s.’}
  • help_text – The date the entry was created.
  • verbose_name – created
user

OneToOneField(‘User‘) (Required)

The user who needs to change his/her password.

Parameters:
  • db_index – True
  • error_messages – {u’invalid_choice’: u’Value %(value)r is not a valid choice.’, u’null’: u’This field cannot be null.’, u’invalid’: u’%(model)s instance with %(field)s %(value)r does not exist.’, u’blank’: u’This field cannot be blank.’, u’unique’: u’%(model_name)s with this %(field_label)s already exists.’, u’unique_for_date’: u’%(field_label)s must be unique for %(date_field_label)s %(lookup_type)s.’}
  • help_text – The user who needs to change his/her password.
  • unique – True
  • verbose_name – user
Meta

get_latest_by = created

ordering = [‘-created’]

unique_together = ()

verbose_name = enforced password change

verbose_name_plural = enforced password changes

PasswordHistory

class password_policies.models.PasswordHistory(*args, **kwargs)

Stores a single password history entry, related to auth.User.

Has the following fields:

created

DateTimeField (Automatically set when created)

The date the entry was created.

Parameters:
  • auto_now_add – True
  • blank – True
  • db_index – True
  • error_messages – {u’unique’: u’%(model_name)s with this %(field_label)s already exists.’, u’null’: u’This field cannot be null.’, u’invalid’: u”’%(value)s’ value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format.”, u’invalid_choice’: u’Value %(value)r is not a valid choice.’, u’invalid_date’: u”’%(value)s’ value has the correct format (YYYY-MM-DD) but it is an invalid date.”, u’blank’: u’This field cannot be blank.’, u’invalid_datetime’: u”’%(value)s’ value has the correct format (YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) but it is an invalid date/time.”, u’unique_for_date’: u’%(field_label)s must be unique for %(date_field_label)s %(lookup_type)s.’}
  • help_text – The date the entry was created.
  • verbose_name – created
password

CharField (Required)

The encrypted password.

Parameters:
  • error_messages – {u’unique’: u’%(model_name)s with this %(field_label)s already exists.’, u’invalid_choice’: u’Value %(value)r is not a valid choice.’, u’null’: u’This field cannot be null.’, u’unique_for_date’: u’%(field_label)s must be unique for %(date_field_label)s %(lookup_type)s.’, u’blank’: u’This field cannot be blank.’}
  • help_text – The encrypted password.
  • max_length – 128
  • validators – [‘MaxLengthValidator‘]
  • verbose_name – password
user

ForeignKey(‘User‘) (Required)

The user this password history entry belongs to.

Parameters:
  • db_index – True
  • error_messages – {u’invalid_choice’: u’Value %(value)r is not a valid choice.’, u’null’: u’This field cannot be null.’, u’invalid’: u’%(model)s instance with %(field)s %(value)r does not exist.’, u’blank’: u’This field cannot be blank.’, u’unique’: u’%(model_name)s with this %(field_label)s already exists.’, u’unique_for_date’: u’%(field_label)s must be unique for %(date_field_label)s %(lookup_type)s.’}
  • help_text – The user this password history entry belongs to.
  • verbose_name – user
Meta

get_latest_by = created

ordering = [‘-created’]

unique_together = ()

verbose_name = password history entry

verbose_name_plural = password history entries