[Dependencies] require Django 1.7 RC1
[mygpo.git] / doc / dev / couchdb-views.rst
blob082a35bd80aed714d761047aa779f22a770047f9
2 CouchDB Views
3 =============
5 This page describes the views that will be used in the CouchDB based backend of
6 the gpodder.net webservice.
8 The views are separated into groups, based on the databases they are indexed
9 on.
11 General
12 -------
14 This group of views is available on the general database, called ``mygpo`` by
15 default.
18 Clients
19 ^^^^^^^
21 Doc-Types: User
23 **Views**
25 * `clients/by_ua_string <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/clients/views/by_ua_string>`_
28 Podcast Lists
29 ^^^^^^^^^^^^^
31 Doc-Types: PodcastList
33 **Views**
35 * `podcastlists/by_rating <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcastlists/views/by_rating>`_
36 * `podcastlists/by_user_slug <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcastlists/views/by_user_slug>`_
37 * `podcastlists/random <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcastlists/views/random>`_
40 Podcasts
41 ^^^^^^^^
43 Doc-Types: Podcast, PodcastGroup, PodcastSubscriberData
45 **Views**
47 * `podcasts/by_tag <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcasts/views/by_tag>`_
50 Suggestions
51 ^^^^^^^^^^^
53 Doc-Types: Suggestions
55 **Views**
57 * `suggestions/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/suggestions/views/by_user>`_
60 Tags
61 ^^^^
63 Doc-Types: Podcast, PodcastGroup
65 **Views**
67 * `tags/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/tags/views/by_podcast>`_
70 Users
71 ^^^^^
73 Doc-Types: User
75 **Views**
77 * `users/by_google_email <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/users/views/by_google_email>`_
78 * `users/deleted <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/users/views/deleted>`_
81 Userdata
82 --------
84 This group of views is available in the *userdata* database, called
85 ``mygpo_userdata`` by default.
87 Chapters
88 ^^^^^^^^
90 Doc-Types: EpisodeUserState
92 **Views**
94 * `chapters/by_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/chapters/views/by_episode>`_
97 Episode Actions
98 ^^^^^^^^^^^^^^^
100 Doc-Types: EpisodeUserState
102 **Views**
104 * `episode_actions/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_device>`_
105 * `episode_actions/by_podcast_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_podcast_device>`_
106 * `episode_actions/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_podcast>`_
107 * `episode_actions/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_actions/views/by_user>`_
110 Episode States
111 ^^^^^^^^^^^^^^
113 Doc-Types: EpisodeUserState
115 **Views**
117 * `episode_states/by_podcast_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_podcast_episode>`_
118 * `episode_states/by_ref_urls <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_ref_urls>`_
119 * `episode_states/by_user_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_user_episode>`_
120 * `episode_states/by_user_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/episode_states/views/by_user_podcast>`_
123 Favorites
124 ^^^^^^^^^
126 Doc-Types: EpisodeUserState
128 **Views**
130 * `episodes/favorites_by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/favorites/views/episodes_by_user>`_
133 Heatmap
134 ^^^^^^^
136 Doc-Types: EpisodeUserState
138 **Views**
140 * `heatmap/by_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/heatmap/views/by_episode>`_
143 History
144 ^^^^^^^
146 Doc-Types: EpisodeUserState, PodcastUserState
148 **Views**
150 * `history/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/history/views/by_device>`_
151 * `history/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/history/views/by_user>`_
154 Listeners
155 ^^^^^^^^^
157 Doc-Types: EpisodeUserState
159 **Views**
161 * `listeners/by_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_episode>`_
162 * `listeners/by_podcast_episode <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_podcast_episode>`_
163 * `listeners/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_podcast>`_
164 * `listeners/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_user>`_
165 * `listeners/by_user_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/by_user_podcast>`_
166 * `listeners/times_played_by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/listeners/views/times_played_by_user>`_
169 Podcast States
170 ^^^^^^^^^^^^^^
172 Doc-Types: PodcastUserState
174 **Views**
176 * `podcast_states/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcast_states/views/by_device>`_
177 * `podcast_states/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcast_states/views/by_podcast>`_
178 * `podcast_states/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/podcast_states/views/by_user>`_
181 Subscribers
182 ^^^^^^^^^^^
184 Doc-Types: PodcastUserState
186 **Views**
188 * `subscribers/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscribers/views/by_podcast>`_
191 Subscriptions
192 ^^^^^^^^^^^^^
194 Doc-Types: PodcastUserState
196 **Views**
198 * `subscriptions/by_device <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscriptions/views/by_device>`_
199 * `subscriptions/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscriptions/views/by_podcast>`_
200 * `subscriptions/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/subscriptions/views/by_user>`_
203 User-Tags
204 ^^^^^^^^^
206 Doc-Types: PodcastUserState
208 **Views**
210 * `usertags/by_podcast <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/usertags/views/by_podcast>`_
211 * `usertags/by_user <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/usertags/views/by_user>`_
212 * `usertags/podcasts <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/usertags/views/podcasts>`_
218 Categories
219 ----------
221 This group of views is available on the categories database, called
222 ``mygpo_categories`` by default.
225 Categories
226 ^^^^^^^^^^
228 Doc-Types: Category
230 **Views**
232 * `categories/by_tags <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/categories/views/by_tags>`_
233 * `categories/by_update <https://github.com/gpodder/mygpo/tree/master/couchdb/general/_design/categories/views/by_update>`_
236 Pubsub
237 ------
239 The following views and design documents relate to the "pubsub" database.
241 Subscriptions
242 ^^^^^^^^^^^^^
244 Doc-Types: Subscription
246 **Views**
248 * `subscriptions/by_topic <https://github.com/gpodder/mygpo/tree/master/couchdb/pubsub/_design/subscriptions/views/by_topic>`_