コード例 #1
0
ファイル: sqlaobject.py プロジェクト: podhmo/hidoi
from hidoi.api import get_display
from pyramid.testing import setUp as make_configurator

config = make_configurator(autocommit=False)
config.include("hidoi")
config.set_default_model_module(locals())
config.add_fixed_widget_management([])

config.add_display(Item)
config.add_display(Bag)
config.commit()

item0 = Item(name="portion", value="heal damage")
bag0 = Bag(name="1stBag")
bag0.items.append(item0)

ditem = get_display(config, item0)


print(ditem)
print(ditem.id)
print(ditem.name)
print(ditem.value)
print(ditem.created_at)


dbag = get_display(config, bag0)
print(dbag._fieldnames)
print([get_display(config, i) for i in dbag.items.value])

コード例 #2
0
    name = sa.Column(sa.String(255), default="", nullable=False)


from hidoi.api import get_display
from pyramid.testing import setUp as make_configurator

config = make_configurator(autocommit=False)
config.include("hidoi")
config.set_default_model_module(locals())
config.add_fixed_widget_management([])

config.add_display(Item)
config.add_display(Bag)
config.commit()

item0 = Item(name="portion", value="heal damage")
bag0 = Bag(name="1stBag")
bag0.items.append(item0)

ditem = get_display(config, item0)

print(ditem)
print(ditem.id)
print(ditem.name)
print(ditem.value)
print(ditem.created_at)

dbag = get_display(config, bag0)
print(dbag._fieldnames)
print([get_display(config, i) for i in dbag.items.value])
コード例 #3
0
def _callFUT(*args, **kwargs):
    from hidoi.api import get_display
    return get_display(*args, **kwargs)