Update to version 0.4.2
[diaspy.git] / manual / notifications.markdown
1 #### `Notifications()` object
2
3 In order to get list of notifications use `diaspy.notifications.Notifications()` object.
4 It support iteration and indexing.
5
6 When creating new instance of `Notifications` only `Connection` object is needed.
7
8 #### Methods
9
10 ##### `last()`
11
12 This method will return you last five notifications.
13
14 ##### `get()`
15
16 This is slightly more advanced then `last()`. It allows you to specify how many
17 notifications per page you want to get and which page you want to recieve.
18
19 ----
20
21 #### `Notification()` model
22
23 Single notification (it should be obvious that it requires object of its own) is located in
24 `diaspy.models.Notification()`. It has several methods you can use.
25
26 ##### 1. `who()`
27
28 This method will return list of guids of the users who caused you to get this notification.
29
30 ##### 2. `when()`
31
32 This method will return UTC time when you get the notification.
33
34 ##### 3. `mark()`
35
36 To mark notification as `read` or `unread`. It has one parameter - `unread` which is boolean.
37
38  
39
40 Also, you can use `str()` and `repr()` on the `Notification()` and you will get nice
41 string.
42
43 ----
44
45 ###### Manual for `diaspy`, written by Marek Marecki