[Python-checkins] r56963 - in tracker: importer/xmlexport2handlers.py instances/python-dev/html/file.item.html instances/python-dev/html/issue.item.html instances/python-dev/schema.py

erik.forsberg python-checkins at python.org
Sun Aug 12 20:38:12 CEST 2007


Author: erik.forsberg
Date: Sun Aug 12 20:38:11 2007
New Revision: 56963

Modified:
   tracker/importer/xmlexport2handlers.py
   tracker/instances/python-dev/html/file.item.html
   tracker/instances/python-dev/html/issue.item.html
   tracker/instances/python-dev/schema.py
Log:

Add description field to 'file' and import from sf. 

Should fix http://psf.upfronthosting.co.za/roundup/meta/issue126.


Modified: tracker/importer/xmlexport2handlers.py
==============================================================================
--- tracker/importer/xmlexport2handlers.py	(original)
+++ tracker/importer/xmlexport2handlers.py	Sun Aug 12 20:38:11 2007
@@ -366,13 +366,15 @@
             filetype = a.find("filetype").text
             file_id = a.find("id").text
             filename = a.find("filename").text
+            description = a.find("description").text
 
-            files.append((date, url, author, filetype, file_id, filename))
+            files.append((date, url, author, filetype, file_id, filename,
+                          description))
 
         files.sort(lambda x, y: cmp(x[0], y[0]))
 
         backoff = 30
-        for timestamp, url, author, filetype, file_id, filename in files:
+        for timestamp, url, author, filetype, file_id, filename, description in files:
             cachefilename = os.path.join("files", "%s-%s-%s-%s.dat" % (tracker_id,
                                                                        aid,
                                                                        file_id,
@@ -384,13 +386,14 @@
             message = mimetools.Message(datafile)
 
             fileprops = ['creator', 'creation', 'activity',
-                         'name', 'type']
+                         'name', 'type', 'description']
 
             filevals = [repr(self.getauthor(author)),
                         repr(time.gmtime(int(timestamp))),
                         repr(time.gmtime(int(timestamp))),
                         repr(filename),
-                        repr(filetype)
+                        repr(filetype),
+                        repr(description),
                         ]
 
             file_nodeid = int(self.db.file.import_list(fileprops, filevals))

Modified: tracker/instances/python-dev/html/file.item.html
==============================================================================
--- tracker/instances/python-dev/html/file.item.html	(original)
+++ tracker/instances/python-dev/html/file.item.html	Sun Aug 12 20:38:11 2007
@@ -24,6 +24,10 @@
   <td tal:content="structure context/name/field"></td>
  </tr>
  <tr>
+  <th i18n:translate="">Description</th>
+  <td tal:content="structure context/description/field"></td>
+ </tr>
+ <tr>
   <th i18n:translate="">Content Type</th>
   <td tal:content="structure context/type/field"/>
   <td style="border: none" tal:condition="python: context.is_edit_ok()">Please note that

Modified: tracker/instances/python-dev/html/issue.item.html
==============================================================================
--- tracker/instances/python-dev/html/issue.item.html	(original)
+++ tracker/instances/python-dev/html/issue.item.html	Sun Aug 12 20:38:11 2007
@@ -194,7 +194,7 @@
  <tr>
   <th i18n:translate="">File name</th>
   <th i18n:translate="">Uploaded</th>
-  <th i18n:translate="">Type</th>
+  <th i18n:translate="">Description</th>
   <th i18n:translate="">Edit</th>
   <th i18n:translate="">Remove</th>
  </tr>
@@ -207,7 +207,7 @@
    <span tal:content="file/creator">creator's name</span>,
    <span tal:content="file/creation">creation date</span>
   </td>
-  <td tal:content="file/type" />
+  <td tal:content="file/description" />
   <td><a tal:condition="file/is_edit_ok"
           tal:attributes="href string:file${file/id}">edit</a>
   </td>

Modified: tracker/instances/python-dev/schema.py
==============================================================================
--- tracker/instances/python-dev/schema.py	(original)
+++ tracker/instances/python-dev/schema.py	Sun Aug 12 20:38:11 2007
@@ -103,6 +103,7 @@
 
 file = FileClass(db, "file",
                 name=String(),
+                description=String(indexme='yes'),
                 spambayes_score=Number(),
                 spambayes_misclassified=Boolean(),)
 
@@ -183,6 +184,7 @@
                                               'author', 'recipients',
                                               'date', 'files', 'messageid',
                                               'inreplyto', 'type',
+                                              'description',
                                               ))
 
     db.security.addPermissionToRole('Anonymous', p)


More information about the Python-checkins mailing list