Example #1
0
    def activities(self):
        """
        Return all activities on this entity.
        """

        b = self.project(type='activity', entity=self)
        b.title = 'Activity on %(title)s' % self

        return b.order(by_whatever(
            'created_time (reversed)',
            'created_time', reverse=True))
Example #2
0
    def my_todo(self):

        if not self.project:
            return

        b = self.project.todo(owner=self)
        b.title = "To-do list for %(title)s" % self

        b.order_method = pitz.by_whatever('xxx', 'milestone', 'status',
            'pscore', reverse=True)

        return b
Example #3
0
    def handle_proj(self, p, options, args, proj):

        results = self.apply_filter_and_grep(p, options, args, proj.todo)

        if options.by_owner:

            results = results.order(pitz.by_whatever('xxx',
                'owner', 'milestone', 'status', 'pscore'))

            # I have to wait to apply the limit until AFTER I sorted the
            # bag.
            if options.limit:
                results = results[:options.limit]

            clepy.send_through_pager(
                results.colorized_by_owner_view

                if self.figure_out_colorization(options.color,
                    proj.me.use_colorization)

                else results.by_owner_view,
                clepy.figure_out_pager(os.environ))

        else:

            if options.limit:
                results = results[:options.limit]

            clepy.send_through_pager(
                results.custom_view(
                    options.custom_view or 'summarized_view',

                    self.figure_out_colorization(
                        options.color,
                        proj.me.use_colorization if proj.me else None)),

                clepy.figure_out_pager(os.environ))