Commit 74fb0ff37becf3d0d872b8beb6e82f23f6f594bd
Committed by
Sergio Oliveira
1 parent
30ad4694
Exists in
trac_indexing
Fixing ticket according to Haystack
Signed-off-by: Thiago Ribeiro <thiagitosouza@hotmail.com>
Showing
2 changed files
with
15 additions
and
0 deletions
Show diff stats
colab/proxy/trac/data_api.py
... | ... | @@ -69,6 +69,7 @@ class TracDataAPI(ProxyDataAPI): |
69 | 69 | ticket.severity = line['severity'] |
70 | 70 | ticket.reporter = line['reporter'] |
71 | 71 | ticket.status = line['status'] |
72 | + ticket.tag = ticket.status | |
72 | 73 | ticket.keywords = line['keywords'] |
73 | 74 | ticket.author = ticket.reporter |
74 | 75 | local_time = line['time']/1000000 | ... | ... |
colab/proxy/trac/models.py
... | ... | @@ -80,6 +80,8 @@ class Revision(models.Model, HitCounterModelMixin): |
80 | 80 | |
81 | 81 | |
82 | 82 | class Ticket(models.Model, HitCounterModelMixin): |
83 | + icon_name = 'tag' | |
84 | + type = 'ticket' | |
83 | 85 | id = models.IntegerField(primary_key=True) |
84 | 86 | summary = models.TextField(blank=True) |
85 | 87 | description = models.TextField(blank=True) |
... | ... | @@ -91,11 +93,23 @@ class Ticket(models.Model, HitCounterModelMixin): |
91 | 93 | reporter = models.TextField(blank=True) |
92 | 94 | author = models.TextField(blank=True) |
93 | 95 | status = models.TextField(blank=True) |
96 | + tag = models.TextField(blank=True) | |
94 | 97 | keywords = models.TextField(blank=True) |
95 | 98 | collaborators = models.TextField(blank=True) |
96 | 99 | created = models.DateTimeField(blank=True, null=True) |
97 | 100 | modified = models.DateTimeField(blank=True, null=True) |
98 | 101 | modified_by = models.TextField(blank=True) |
102 | + | |
103 | + @property | |
104 | + def title(self): | |
105 | + return u'#{} - {}'.format(self.id, self.summary) | |
106 | + | |
107 | + @property | |
108 | + def description(self): | |
109 | + return u'{}\n{}\n{}\n{}\n{}\n{}\n{}'.format( | |
110 | + self.description, self.milestone, self.component, self.severity, | |
111 | + self.reporter, self.keywords, self.collaborators | |
112 | + ) | |
99 | 113 | |
100 | 114 | class Meta: |
101 | 115 | verbose_name = _('Attachment') | ... | ... |