本文整理汇总了Python中multiproduct.model.Product._get_schema方法的典型用法代码示例。如果您正苦于以下问题:Python Product._get_schema方法的具体用法?Python Product._get_schema怎么用?Python Product._get_schema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiproduct.model.Product
的用法示例。
在下文中一共展示了Product._get_schema方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dict
# 需要导入模块: from multiproduct.model import Product [as 别名]
# 或者: from multiproduct.model.Product import _get_schema [as 别名]
from trac.core import Component, implements
from trac.db_default import schema as tracschema
from trac.util.text import printout
from trac.util.translation import _
from trac.wiki.admin import WikiAdmin
from trac.wiki.model import WikiPage
from bhdashboard import wiki
try:
from multiproduct.model import Product, ProductResourceMap, ProductSetting
except ImportError:
Product = ProductResourceMap = ProductSetting = None
schema = tracschema[:]
if Product is not None:
schema.extend([Product._get_schema(), ProductResourceMap._get_schema(),
ProductSetting._get_schema()])
structure = dict([(table.name, [col.name for col in table.columns])
for table in schema])
# add product for any columns required
for table in ['ticket']:
structure[table].append('product')
# probably no point in keeping data from these tables
ignored = ['auth_cookie', 'session', 'session_attribute', 'cache']
IGNORED_DB_STRUCTURE = dict([(k, structure[k]) for k in ignored])
DB_STRUCTURE = dict([(k, structure[k]) for k in structure if k not in ignored])