From 0f4565b8abc6d8cca881d8b92cd38bd127f7f2fd Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 6 Apr 2007 12:53:50 +0000 Subject: [PATCH] html is longtext, no empty_flash items in json --- oilarchive/config/app.cfg | 1 + oilarchive/model.py | 7 +++++-- oilarchive/templates/master.kid | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/oilarchive/config/app.cfg b/oilarchive/config/app.cfg index 3e39cad..75539ec 100644 --- a/oilarchive/config/app.cfg +++ b/oilarchive/config/app.cfg @@ -25,6 +25,7 @@ # Allow every exposed function to be called as json, # tg.allow_json = False +tg.empty_flash = False # List of Widgets to include on every page. # for exemple ['turbogears.mochikit'] diff --git a/oilarchive/model.py b/oilarchive/model.py index 540ae19..7b9020c 100644 --- a/oilarchive/model.py +++ b/oilarchive/model.py @@ -50,7 +50,10 @@ WHERE %s ORDER BY %s""" % \ item = ArchiveItem.get(m[0]) if not max_score: max_score = m[1] / 100 - item.score = m[1] / max_score + if max_score: + item.score = m[1] / max_score + else: + item.score = m[1] result.append(item) return result @@ -63,7 +66,7 @@ class ArchiveItem(SQLObject): author = UnicodeCol() authorSort = UnicodeCol(default = '') description = UnicodeCol() # text(for rss) - html = UnicodeCol() #(for page, contains javascript) + html = UnicodeCol(length = 2**25) #(for page, contains javascript) text = UnicodeCol(length = 2**25) #Fulltext relDate = DateTimeCol() #timestamp (item released) pubDate = DateTimeCol() #timestamp (item published) diff --git a/oilarchive/templates/master.kid b/oilarchive/templates/master.kid index 7420684..362b2c8 100644 --- a/oilarchive/templates/master.kid +++ b/oilarchive/templates/master.kid @@ -158,7 +158,7 @@ if search['length'] > search['o'] + search['n']: