pluserable.data.models module

Base model classes for any backend (SQLAlchemy, ZODB etc.).

class pluserable.data.models.ActivationBase(code='', valid_until=None, created_by='web')[source]

Bases: object

Handles activations and password reset items for users.

code is a random hash that is valid only once. Once the hash is used to access the site, it is removed.

valid_until is a datetime until when the activation key will last.

created_by is a system: new user registration, password reset, forgot password etc.

class pluserable.data.models.GroupBase[source]

Bases: object

Base class for a Group model.

class pluserable.data.models.UserBase(email, password, salt='', activation=None, **kw)[source]

Bases: object

Base class for a User model.

check_password(password)[source]

Check the password and return a boolean.

Return type

bool

classmethod generate_random_password(chars=12)[source]

Generate random string of fixed length.

This method is not used in the pluserable system, but offered anyway.

gravatar_url(default='mm', size=80, cacheable=True)[source]

Return a Gravatar image URL for this user.

property is_activated

Return False if this user needs to confirm her email address.

property password

Set the password, or retrieve the password hash.

pluserable.data.models.thirty_days_from_now(now=None)[source]

Return a datetime pointing to exactly 30 days in the future.

Return type

datetime