User Record

Represents a single record in the Startkladde users table, which contains one record for each registred user of the web interface.

Interface

class pysk.db.model.User(id=None, username=None, password=None, perm_club_admin=None, perm_read_flight_db=None, club=None, person_id=None, comments=None)

Implementation of a user record for the Startkladde users table

Stores one record of the database containing a registred user of the Startkladde webinterface.

Parameters:
  • id (int) – ID of this user record in table users
  • username (str) – Login
  • password (str) – Password hash (see hashPassword)
  • perm_club_admin (int) – Club admin rights. (use 1 for granted, 0 for not granted)
  • perm_read_flight_db (int) – Allowed to read flight database (use 1 for yes, 0 for no)
  • club (str) – Club name
  • person_id (int) – ID of related person record in people table (ref Pilot Record)
  • comments (str) – Comments
__eq__(other)

Equal comparison

Two users are defined equal, if and only if their usernames are equal

Parameters:other (User) – Instance to compare to
Returns:True if and only if self and other are equal
__hash__()

Hash for object.

Returns:username.__hash__()
__str__()

Convert instance to string

Returns:username
static hashPassword(password)

Hash Password similar to startkladde

Returns:Hashed version of password as required for storage in password
setPassword(password)

Set new password for user

Resets the current password to password, after hashing the input string with hashPassword.

Parameters:password (str) – Clear text password
static tableName()

Get name of MySQL table, where this data type is used

Returns:users