Skip to content

Commit

Permalink
mpttプラグインのスケルトン作成 #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Hosoda Kenji committed Aug 12, 2011
1 parent 0fdd63b commit a19517a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def _make_widgets_list(*plugin_names):
'plugin_tablecheckbox',
'plugin_tablepermuter',
)),
('Cateogry Tools',
_make_widgets_list(
'plugin_mptt',
)),
('Custom Validators',
[('xxx Validator',
URL('plugin_horizontal', 'index'),
Expand Down
11 changes: 11 additions & 0 deletions controllers/plugin_mptt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
from plugin_solidtable import SOLIDTABLE
from gluon.contrib.populate import populate

db = DAL('sqlite:memory:')
db.define_table('product', Field('name'))
populate(db.product, 10)

def index():
table = SOLIDTABLE(db(db.product.id>0).select(), renderstyle=True)
return dict(table=table)
5 changes: 5 additions & 0 deletions models/web2py_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
short_description='',
long_description='',
),
plugin_mptt=dict(
label='Modified Preorder Tree Traversal',
short_description='',
long_description='',
),
)

if request.controller.startswith('plugin_'):
Expand Down
2 changes: 2 additions & 0 deletions modules/plugin_mptt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from gluon import *

0 comments on commit a19517a

Please sign in to comment.