[Django][s6]: Google Gears ========================== 2007/12/12 翔泳社さんにて開催の `Python Workshop the Edge 2007`_ でLTを発表させていただきました。資料を掲載します。当日は持ち時間ちょうどでしたので触れませんでしたがDjangoついての情報も載せています。 .. _`Python Workshop the Edge 2007`: http://www.python.jp/Zope/workshop/200712 自己紹介 -------- - id:MiCHiLU - http://michilu.com - takanao@endoh.tk Django オンラインドキュメント和訳 --------------------------------- http://michilu.com/django/doc-ja/index/ .. image:: /static/media/20071212/djangoproject120x25.gif :width: 20% :align: center Google Code ----------- http://code.google.com/u/Takanao.Endoh/ Google Gears ------------ http://gears.google.com/ http://code.google.com/p/google-gears/ .. image:: /static/media/20071212/icon.png :width: 20% :align: center Google Gears is --------------- an open source browser extension that lets developers create web applications that can run offline. - Google Reader (en) - Django オンラインドキュメント和訳 Require ------- - Firefox 1.5+, IE 6+ (Safari) - JavaScript Features -------- - LocalServer - Databese - WorkerPool .. image:: /static/media/20071212/icon.png :width: 15% .. image:: /static/media/20071212/localserver.gif :width: 20% .. image:: /static/media/20071212/database.gif :width: 20% .. image:: /static/media/20071212/workerpool.gif :width: 20% LocalServer ----------- .. image:: /static/media/20071212/localserver.gif :width: 20% :align: center Cache and serve application resources locally (HTML, JavaScript, images, etc.) Database -------- .. image:: /static/media/20071212/database.gif :width: 20% :align: center Store data locally in a fully-searchable relational database (SQLite) WorkerPool ---------- .. image:: /static/media/20071212/workerpool.gif :width: 20% :align: center Run asynchronous Javascript to improve application responsiveness (threading) DEMO ---- Django オンラインドキュメント和訳 http://michilu.com/django/doc-ja/index/ Sample Code ----------- Django Views ------------ :: def doc_index_json(request, target_dir, base_url, callback=None): result = dict() timestamp_dict = util.get_timestamp(target_dir, extension=".txt") for key, value in timestamp_dict.items(): key = base_url % key[:key.rindex(".")] result[key] = dateformat.DateFormat(value).format("r") result = "[%s]" % simplejson.dumps(result) if callback: result = to_jsonp(callback, result) return HttpResponse(result, mimetype=mimetype("json")) Django Views ------------ 詳しくは `http://michilu.googlecode.com /svn/trunk/doc/views.py `_ JavaScript ---------- :: function updating (JSON) { count.reset(); for (var key in JSON){ if ( localServer.isCaptured(url) && Date.parse(JSON[key]) <= Date.parse( localServer.getHeader(url, "Last-Modified"))) { } else { count.up(); localServer.capture(url, function(){count.down();}); }; }; }; JavaScript ---------- 詳しくは http://michilu.com/static/doc-ja/js/site.js Google Gears Databese --------------------- SQL on JavaScript Google Gears ORM ---------------- http://www.urielkatz.com/archive/tag/GearsORM/ with Django ----------- Django Offline -------------- http://code.google.com/p/django-offline/ >< ---- ソースは まだ ないよ (はぁと) Architecture ------------ :: UI | jQuery | Switcher <-- (Online) --> Django <--> Database ^ | +- (Online? Offline?) --> Google Gears (Database) Architecture ------------ |Architecture| .. |Architecture| image:: /static/media/20071212/Ggarch.jpg :width: 100% :align: middle via `apexdevnet.com `_ まとめ ------ Google Gears は便利 Django なら 「 **オフ** ラインドキュメント和訳 」 があるよ! |by| ---- ご清聴ありがとうございました .. |by| image:: /static/media/20071212/sleepy.jpg :width: 100% :align: middle .. s6.page.tmp({ separator: 'fade', styleBase: 'custom', styles: [ { left: '0%', top: '-15%', width: '100%' }, { display: 'none', width: '100%', textAlign: 'center', top: '90%', background: 'black' } ], actions: [ [ [1, 'fade in', 0.4] ] ] }); Extras ------ Django-ja 絶賛募集中!!! ----------------------- 和訳してくれる人も募集中!!! --------------------------- Django-ja at lingr ------------------ http://www.lingr.com/room/django-ja Django 紹介 ----------- MVC vs MVT, TESTツール付属, バッテリ付属, スケーラビリティ, SQLArchemy, Cache, クールなAdmin画面, Middleware, Generic Views and more Google Code -------------------- - `Django REST Interface `_ - `Django OpenID Auth `_ - `Django Mobile JP `_ Documents --------- - `本家Wiki `_ - `日本語Wiki `_ hosted by `ueblog `_ The END ------- ---- http://MiCHiLU.com/blog/posts/127/ - Added at Sat, 15 Dec 2007 22:20:46 +0900 - Last modified at Sat, 15 Dec 2007 22:23:27 +0900 This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.1 Japan License. http://creativecommons.org/licenses/by-nc-sa/2.1/jp/