From 2f015418f007eb871477eaf631b33d45bc931a55 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 20 Mar 2007 16:09:12 +0000 Subject: [PATCH] sql names --- oilarchive/controllers.py | 4 +- oilarchive/model.py | 2 +- oilarchive/oilcache.py | 2 +- oilarchive/static/css/style.css | 124 ------------------------------- oilarchive/templates/master.kid | 37 ++++----- oilarchive/templates/view.kid | 2 +- oilarchive/templates/welcome.kid | 39 +--------- 7 files changed, 22 insertions(+), 188 deletions(-) diff --git a/oilarchive/controllers.py b/oilarchive/controllers.py index 52eb4c2..c3eebbb 100644 --- a/oilarchive/controllers.py +++ b/oilarchive/controllers.py @@ -25,7 +25,7 @@ class View: @expose() def default(self, id, *args, **kw): try: - item = ArchiveItem.byHash(id) + item = ArchiveItem.byHashId(id) if not args: return self.view(item) elif args[0] == 'icon.png': @@ -38,6 +38,8 @@ class View: class Root(controllers.RootController): + view = View() + @expose(template=".templates.welcome") # @identity.require(identity.in_group("admin")) def index(self): diff --git a/oilarchive/model.py b/oilarchive/model.py index edac434..9c31804 100644 --- a/oilarchive/model.py +++ b/oilarchive/model.py @@ -13,7 +13,7 @@ __connection__ = hub class ArchiveItem(SQLObject): - hash = UnicodeCol(alternateId = True) + hashId = UnicodeCol(alternateID = True, length=128) title = UnicodeCol() description = UnicodeCol() author = UnicodeCol() diff --git a/oilarchive/oilcache.py b/oilarchive/oilcache.py index 4b0f60e..46b0f28 100644 --- a/oilarchive/oilcache.py +++ b/oilarchive/oilcache.py @@ -25,7 +25,7 @@ def icon(item): icon_root = join(cache_root, 'icon') if not exists(icon_root): os.makedirs(icon_root) - icon = join(icon_root, "%s.png" % item.hash) + icon = join(icon_root, "%s.png" % item.hashId) if exists(icon): data = laod_file(icon) else: diff --git a/oilarchive/static/css/style.css b/oilarchive/static/css/style.css index 1bc7d64..e69de29 100644 --- a/oilarchive/static/css/style.css +++ b/oilarchive/static/css/style.css @@ -1,124 +0,0 @@ -/* - * Quick mash-up of CSS for the TG quick start page. - */ - -html, body, th, td { - color: black; - background-color: #ddd; - font: x-small "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif; - margin: 0; - padding: 0; -} - -#header { - height: 80px; - width: 777px; - background: blue URL('../images/header_inner.png') no-repeat; - border-left: 1px solid #aaa; - border-right: 1px solid #aaa; - margin: 0 auto 0 auto; -} - -a.link, a, a.active { - color: #369; -} - - -#main_content { - color: black; - font-size: 127%; - background-color: white; - width: 757px; - margin: 0 auto 0 auto; - border-left: 1px solid #aaa; - border-right: 1px solid #aaa; - padding: 10px; -} - -#sidebar { - border: 1px solid #aaa; - background-color: #eee; - margin: 0.5em; - padding: 1em; - float: right; - width: 200px; - font-size: 88%; -} - -#sidebar h2 { - margin-top: 0; -} - -#sidebar ul { - margin-left: 1.5em; - padding-left: 0; -} - -h1,h2,h3,h4,h5,h6,#getting_started_steps { - font-family: "Century Schoolbook L", Georgia, serif; - font-weight: bold; -} - -h2 { - font-size: 150%; -} - -#getting_started_steps a { - text-decoration: none; -} - -#getting_started_steps a:hover { - text-decoration: underline; -} - -#getting_started_steps li { - font-size: 80%; - margin-bottom: 0.5em; -} - -#getting_started_steps h2 { - font-size: 120%; -} - -#getting_started_steps p { - font: 100% "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif; -} - -#footer { - border: 1px solid #aaa; - border-top: 0px none; - color: #999; - background-color: white; - padding: 10px; - font-size: 80%; - text-align: center; - width: 757px; - margin: 0 auto 1em auto; -} - -.code { - font-family: monospace; -} - -span.code { - font-weight: bold; - background: #eee; -} - -#status_block { - margin: 0 auto 0.5em auto; - padding: 15px 10px 15px 55px; - background: #cec URL('../images/ok.png') left center no-repeat; - border: 1px solid #9c9; - width: 450px; - font-size: 120%; - font-weight: bolder; -} - -.notice { - margin: 0.5em auto 0.5em auto; - padding: 15px 10px 15px 55px; - width: 450px; - background: #eef URL('../images/info.png') left center no-repeat; - border: 1px solid #cce; -} diff --git a/oilarchive/templates/master.kid b/oilarchive/templates/master.kid index f13dad6..cd0cf41 100644 --- a/oilarchive/templates/master.kid +++ b/oilarchive/templates/master.kid @@ -20,29 +20,22 @@
- -