diff --git a/colab/proxy/trac/data_api.py b/colab/proxy/trac/data_api.py index 8a39c58..82c55e0 100644 --- a/colab/proxy/trac/data_api.py +++ b/colab/proxy/trac/data_api.py @@ -15,7 +15,7 @@ class TracDataAPI(ProxyDataAPI): self.fetch_data_attachment(cursor) self.fetch_data_ticket(cursor) self.fetch_data_revision(cursor) - + def fetch_data_attachment(self, cursor): attachment = Attachment() cursor.execute(''' SELECT * from attachment; ''') @@ -32,7 +32,7 @@ class TracDataAPI(ProxyDataAPI): + "/" + attachment.filename local_time = line['time']/1000000 attachment.modified = time.strftime('%Y-%m-%d %H:%M:%S', - time.localtime(local_time)) + time.localtime(local_time)) if match("\.(\w+)$", attachment.filename): attachment.mimetype = attachment.filename.lower() attachment.save() @@ -52,7 +52,7 @@ class TracDataAPI(ProxyDataAPI): revision.created = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(local_time)) revision.repository_name = repository_dict[line['value']] - + def fetch_data_ticket(self, cursor): ticket = Ticket() collaborators = [] @@ -74,13 +74,12 @@ class TracDataAPI(ProxyDataAPI): ticket.author = ticket.reporter local_time = line['time']/1000000 ticket.created = time.strftime('%Y-%m-%d %H:%M:%S', - time.localtime(local_time)) + time.localtime(local_time)) ticket.modified = str(timezone.now()) ticket.modified_by = ticket.author if line['report'] not in collaborators: - collaborators.append(line['report']) + collaborators.append(line['report']) ticket.collaborators = collaborators - def fetch_data_wiki(self, cursor): wiki = Wiki() diff --git a/colab/proxy/trac/models.py b/colab/proxy/trac/models.py index 6b3f31c..4301ab0 100644 --- a/colab/proxy/trac/models.py +++ b/colab/proxy/trac/models.py @@ -60,7 +60,7 @@ class Revision(models.Model, HitCounterModelMixin): repository_name = models.TextField(blank=True) created = models.DateTimeField(blank=True, null=True) modified = models.DateTimeField(blank=True, null=True) - + @property def title(self): return u'{} [{}]'.format(self.repository_name, self.rev) @@ -99,17 +99,17 @@ class Ticket(models.Model, HitCounterModelMixin): created = models.DateTimeField(blank=True, null=True) modified = models.DateTimeField(blank=True, null=True) modified_by = models.TextField(blank=True) - + @property def title(self): - return u'#{} - {}'.format(self.id, self.summary) - + return u'#{} - {}'.format(self.id, self.summary) + @property def description(self): return u'{}\n{}\n{}\n{}\n{}\n{}\n{}'.format( self.description, self.milestone, self.component, self.severity, self.reporter, self.keywords, self.collaborators - ) + ) class Meta: verbose_name = _('Attachment') @@ -143,7 +143,7 @@ class Wiki(Collaboration, HitCounterModelMixin): @property def description(self): - return u'{}\n{}'.format(self.wiki_text, self.collaborators) + return u'{}\n{}'.format(self.wiki_text, self.collaborators) class Meta: verbose_name = _('Attachment') -- libgit2 0.21.2