浏览代码

[metastore] Replace 'None' with 'NULL' in table sample

https://github.com/cloudera/hue/pull/144
dbeech 11 年之前
父节点
当前提交
9e0eb37981
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      apps/metastore/src/metastore/templates/sample.mako

+ 7 - 1
apps/metastore/src/metastore/templates/sample.mako

@@ -37,7 +37,13 @@ from django.utils.translation import ugettext as _
       % for i, row in enumerate(sample):
       <tr>
         % for item in row:
-        <td>${ smart_unicode(item, errors='ignore') }</td>
+        <td>
+          % if item is None:
+            NULL
+          % else:
+            ${ escape(smart_unicode(item, errors='ignore')).replace(' ', '&nbsp;') | n,unicode }
+          % endif
+        </td>
         % endfor
       </tr>
       % endfor