Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar_network_webui/cursors.py
blob: 9e4bc8b338f5c4ce54b2e63c064d82157cc83215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Sebastian Silva
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from client import Client


class Mount:
    def __init__(self, clone=None):
        self.client = Client()

        if not clone:
            self.Contexts = self.client.Context.cursor(
                type=["activity", "project"],
                reply=['guid', 'type', 'title', 'author', 'summary',
                        'description', 'layer', 'mtime'],
                order_by='-mtime')
            self.autocomplete_Contexts = self.client.Context.cursor(
                reply=['guid', 'title'], order_by='-mtime')

            self.feed_Contexts = self.client.Context.cursor( page_size=15, 
                reply=['guid', 'title', 'description', 'author', 'ctime', 'mtime'],
                order_by='-mtime')
    
            self.Projects = self.client.Context.cursor(type='project',
                reply=['guid', 'type', 'title', 'author', 'summary',
                        'description', 'layer', 'mtime'],
                order_by='-mtime')
            self.Activities = self.client.Context.cursor(type='activity',
                reply=['guid', 'type', 'title', 'author', 'summary',
                        'description', 'layer', 'mtime'],
                order_by='-mtime')
        else:
            self.Contexts = self.client.Context.cursor(
                layer='clone',
                reply=['guid', 'type', 'title', 'author', 'summary',
                        'description', 'layer', 'mtime'],
                order_by='-mtime')
            self.autocomplete_Contexts = self.client.Context.cursor(
                layer='clone',
                reply=['guid', 'title'],
                order_by='-mtime')

            self.feed_Contexts = self.client.Context.cursor( page_size=15, 
                layer='clone',
                reply=['guid', 'title', 'description', 'author', 'ctime', 'mtime'],
                order_by='-mtime')
    
            self.Projects = self.client.Context.cursor(type='project',
                reply=['guid', 'type', 'title', 'author', 'summary',
                        'description', 'layer', 'mtime'],
                order_by='-mtime')
            self.Activities = self.client.Context.cursor(type='activity',
                layer='clone',
                reply=['guid', 'type', 'title', 'author', 'summary',
                        'description', 'layer', 'mtime'],
                order_by='-mtime')

        self.Questions = self.client.Feedback.cursor(type="question",
            reply=['guid', 'type', 'title', 'content', 'context', 'author',
                    'tags', 'mtime'], order_by='-mtime')
        self.Problems = self.client.Feedback.cursor(type="problem",
            reply=['guid', 'type', 'title', 'content', 'context', 'author',
                    'tags', 'mtime'], order_by='-mtime')
        self.Ideas = self.client.Feedback.cursor(type="idea",
            reply=['guid', 'type', 'title', 'content', 'context', 'author',
                    'tags', 'mtime'], order_by='-mtime')
        self.Solutions = self.client.Solution.cursor(
            reply=['guid', 'content', 'feedback', 'author', 'tags',
                    'mtime'], order_by='-mtime')
        self.Comments = self.client.Comment.cursor(
            reply=['guid', 'message', 'tags', 'author',
                    'feedback', 'review', 'solution', 'mtime'])
        self.Reviews = self.client.Review.cursor(
            reply=['guid', 'content', 'context', 'author',
                    'tags', 'mtime'], order_by='-mtime')
        self.Resources = self.client.Feedback.cursor(
            reply=['guid', 'type', 'title', 'content', 'context', 'author',
                    'tags', 'mtime'], order_by='-mtime')
        self.feed_Resources = self.client.Feedback.cursor(
            reply=['guid', 'type', 'title', 'content', 'context', 'author',
                    'tags', 'mtime', 'ctime'], order_by='-mtime')
        self.Artifacts = self.client.Artifact.cursor(
            reply=['guid', 'title', 'description', 'context',
                    'author', 'tags', 'mtime'],
            order_by='-mtime')


network_mount = Mount()
home_mount = Mount(True)