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