mewlo.mpacks.core.user.muser module

muser.py

This model represents users.

class mewlo.mpacks.core.user.muser.MewloUser[source]

Bases: mewlo.mpacks.core.database.mdbmodel.MewloDbModel

User object / database model.

actions_after_login()[source]

If there are any actions we want to do after every login, this is where to do that.

calc_nice_rbaclabel()[source]

Return a nice label used for displaying rbac information.

classmethod create_prerequisites(dbmanager)[source]

Create and register with the dbmanager any prerequisite stuff that this class uses.

dbtablename = 'user'
classmethod define_fields(dbmanager)[source]

This class-level function defines the database fields for this model – the columns, etc.

does_plaintextpasswordmatch(plaintextpassword)[source]

Return true if the plaintext password is a match for our stored hashed password.

dumps(indent=0)[source]
classmethod find_one_bynameorid(nameorid)[source]
flag_mixin_atroot = False
get_date_lastlogin()[source]
get_email_htmlinfo(request)[source]

Return an html string that describes their email and email status. For example: mouser@donationcoder.com (verified). or: mouser@donationcoder.com (not yet verified; <a href=”“>resend verification email</a>). or mouser@donationcoder.com, pending change to mouser2@dcmembers.org (<a href=”“>resend confirmation email</a> or <a href=”“>cancel change</a>). or no email address provided (provide one now).

get_fieldvalue_and_verificationstatus(fieldname)[source]

Return tuple (fieldvalue, isverified) for this field.

get_isloggedin()[source]

Return true if this is a real user logged in, and not guest account, etc.

get_ispending_fieldmodify_verification(request)[source]

Is this user account pending a field modificationverification?

get_ispending_newuser_verification()[source]

Is this user account pending a newuser verification?

get_username()[source]

Accessor.

getfield_byname(fieldname, defaultval=None)[source]

Accessor.

has_recently_loggedin(recentminutes)[source]

Return true if they have logged in (or provided password) in last recentminutes minutes.

init()[source]

Manually called init on manually created new instances.

is_field_verified(fieldname)[source]

Return True if field value is verified.

is_safe_stranger_claim_thisaccount()[source]

This is called if someone claims to have entered the wrong email after just creating an account; return True if we want to let them change the email address of this account. We should only allow this on accounts which have never been logged into or had anything done with. Allowing this makes it much easier for someone who provides a bad email at signup to fix it.

set_fieldvalue_with_verificationstate(varname, varval, verificationstate)[source]

Set value of a field and makring it as verified.

update_date_lastlogin()[source]

Update date of last login.

upgrade_passwordhash_ifneeded()[source]

Here we can check their hashed stored password, and if we have upgraded password algorithms since theirs, we could regenerated it and save it.

class mewlo.mpacks.core.user.muser.MewloUserTemp[source]

Bases: mewlo.mpacks.core.user.muser.MewloUser

Derived from MewloUser but won’t save to db.

get_isloggedin()[source]

Return true if this is a real user logged in, and not guest account, etc.

init()[source]

Manually called init on manually created new instances.

save()[source]

Raise exception if we try to save temp user.