This module is here to allow basic manipulation with users. It allows you to retreive all blogposts for fiven user, upload new concepts, register blog and so on.
User(username, password=None, lazy=False)¶
Class that is used to hold informations about given username. You can also command various operations, like get list of all blogs, or add new concept.
str, default None – Password for logged user.
bool – Is the user logged in?
Does the user have registered blog?
Parse additional informations about user. This step require one request to the site.
Transform user_id to instance of
Userinstance parsed from the user_id.
Return type: obj
Logs the user in, tests, if the user is really logged.
Parameters: password (str, default None) – Password, overwrites the password set when the object was created. Raises:
UserWarning– if there was some error during login.
Lists all of users PUBLISHED blogposts. For unpublished, see
Returns: sorted (old->new) list of Blogpost objects. Return type: list
Return all concepts (unpublished blogs).
Returns: List of Concept objects. Return type: list
add_concept(text, title, ts_of_pub=None)¶
Adds new concept into your concepts.
UserWarning– if the site is broken or user was logged out.
Register blog under blog_name. Users doesn’t have blogs automatically, you have to create them manually.
UserWarning– If user already have blog registered.
ValueError– If it is not possible to register blog for user (see exception message for details).