Beispiel #1
0
    def create_task(self, name, status, description='', MU_type='md'):
        """MarkUp type defaults to 'markdown'
        """
        _status = Statuses.get(name=status)
        _t = Tasks()
        _d = str(datetime.datetime.now())
        _t.name = name
        _t.description = description
        _t.status = _status
        _t.md5hash = md5(_d + name)
        _t.position = Tasks.select().where(Tasks.status == _status).count()
        _t.project = Projects.get_or_create(name=self.name)
        _t.save()

        # TODO save task on disk, inside the repo
        #if description == '':
            #description = name
        #self.tasks_files.create_doc(name+'.'+MU_type, description)
        #self.tasks_files.create_doc(name, description)
        #self.r.add_file(self.r.path+'/tasks/'+name)
        print '*' * 100
        print self.tasks_files.root_path
        print 'tasks fullpath: ' + self.tasks_fullpath + '/' + name + '.'\
            + MU_type
        print '*' * 100
Beispiel #2
0
    def create_task(self, name, status, description='', MU_type='md'):
        """MarkUp type defaults to 'markdown'
        """
        _status = Statuses.get(name=status)
        _t = Tasks()
        _d = str(datetime.datetime.now())
        _t.name = name
        _t.description = description
        _t.status = _status
        _t.md5hash = md5(_d + name)
        _t.position = Tasks.select().where(Tasks.status == _status).count()
        _t.project = Projects.get_or_create(name=self.name)
        _t.save()

        self.tasks_files.create_doc(name + '.' + MU_type, description)
        self.r.add_file(self.tasks_fullpath + '/' + name + '.' + MU_type)
        self.tasks_files.cache(name + '.' + MU_type)