diff options
author | Mike Crute <mcrute@gmail.com> | 2010-07-15 00:03:46 -0400 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2010-07-15 00:03:46 -0400 |
commit | 4065f0b0d6f4fbbdf04c0707ce49c8ffbc687032 (patch) | |
tree | ac7c4ab8b8cc3f129ca5008c88103c5ce5bb6f6a /snakeplan/api/handlers.py | |
parent | 7359bd23ec232c238fc07c579776f7869dd3f00d (diff) | |
download | snakeplan-4065f0b0d6f4fbbdf04c0707ce49c8ffbc687032.tar.bz2 snakeplan-4065f0b0d6f4fbbdf04c0707ce49c8ffbc687032.tar.xz snakeplan-4065f0b0d6f4fbbdf04c0707ce49c8ffbc687032.zip |
Adding JSON API.
Diffstat (limited to 'snakeplan/api/handlers.py')
-rw-r--r-- | snakeplan/api/handlers.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/snakeplan/api/handlers.py b/snakeplan/api/handlers.py new file mode 100644 index 0000000..0377ffc --- /dev/null +++ b/snakeplan/api/handlers.py | |||
@@ -0,0 +1,26 @@ | |||
1 | from piston.handler import BaseHandler | ||
2 | from projects import models | ||
3 | |||
4 | |||
5 | class ProjectHandler(BaseHandler): | ||
6 | |||
7 | allowed_methods = ('GET', ) | ||
8 | exclude = () | ||
9 | model = models.Project | ||
10 | |||
11 | |||
12 | class TaskHandler(BaseHandler): | ||
13 | |||
14 | allowed_methods = ('GET', ) | ||
15 | exclude = () | ||
16 | model = models.Task | ||
17 | |||
18 | |||
19 | class ProjectStoryHandler(BaseHandler): | ||
20 | |||
21 | allowed_methds = ('GET', ) | ||
22 | exclude = () | ||
23 | model = models.Project | ||
24 | |||
25 | def read(self, request, id): | ||
26 | return self.model.objects.get(id=id).stories.all() | ||