diff --git a/colab/proxy/trac/data_api.py b/colab/proxy/trac/data_api.py index cce796f..42965ca 100644 --- a/colab/proxy/trac/data_api.py +++ b/colab/proxy/trac/data_api.py @@ -13,7 +13,9 @@ class TracDataAPI(ProxyDataAPI): cursor = connection.cursor() self.fetch_data_wiki(cursor) 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; ''') @@ -22,13 +24,14 @@ class TracDataAPI(ProxyDataAPI): attachment.description = line['description'] attachment.id = line['attach_id'] attachment.filename = line['filemame'] + attachment.title = attachment.filename attachment.size = line['size'] attachment.author = line['author'] attachment.used_by = line['type'] attachment.url = attachment.user_by + "/" + attachment.id \ + "/" + attachment.filename local_time = line['time']/1000000 - attachment.created = time.strftime('%Y-%m-%d %H:%M:%S', + attachment.modified = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(local_time)) if match("\.(\w+)$", attachment.filename): attachment.mimetype = attachment.filename.lower() diff --git a/colab/proxy/trac/models.py b/colab/proxy/trac/models.py index d505c4e..1c332a9 100644 --- a/colab/proxy/trac/models.py +++ b/colab/proxy/trac/models.py @@ -13,13 +13,16 @@ from django.utils.translation import ugettext_lazy as _ class Attachment(models.Model, HitCounterModelMixin): + type = 'attachment' + icon_name = 'file' url = models.TextField(primary_key=True) attach_id = models.TextField() used_by = models.TextField() filename = models.TextField() author = models.TextField(blank=True) + title = models.TextField(blank=True) description = models.TextField(blank=True) - created = models.DateTimeField(blank=True) + modified = models.DateTimeField(blank=True) mimetype = models.TextField(blank=True) size = models.IntegerField(blank=True) -- libgit2 0.21.2