本文整理汇总了Python中oscar.core.loading.get_model方法的典型用法代码示例。如果您正苦于以下问题:Python loading.get_model方法的具体用法?Python loading.get_model怎么用?Python loading.get_model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oscar.core.loading
的用法示例。
在下文中一共展示了loading.get_model方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: remove_ancestor_slugs
# 需要导入模块: from oscar.core import loading [as 别名]
# 或者: from oscar.core.loading import get_model [as 别名]
def remove_ancestor_slugs(apps, schema_editor):
MigrationCategory = apps.get_model('catalogue', 'Category')
for category in MigrationCategory.objects.all():
category.slug = category.slug.split(ORMCategory._slug_separator)[-1]
category.save()
示例2: add_ancestor_slugs
# 需要导入模块: from oscar.core import loading [as 别名]
# 或者: from oscar.core.loading import get_model [as 别名]
def add_ancestor_slugs(apps, schema_editor):
MigrationCategory = apps.get_model('catalogue', 'Category')
for category in MigrationCategory.objects.all():
orm_category = ORMCategory.objects.get(pk=category.pk)
category.slug = orm_category.full_slug
category.save()
示例3: get_target_property
# 需要导入模块: from oscar.core import loading [as 别名]
# 或者: from oscar.core.loading import get_model [as 别名]
def get_target_property():
return get_model('catalogue', 'Product')
示例4: target_model
# 需要导入模块: from oscar.core import loading [as 别名]
# 或者: from oscar.core.loading import get_model [as 别名]
def target_model(self):
return get_model('catalogue', 'product')
示例5: __init__
# 需要导入模块: from oscar.core import loading [as 别名]
# 或者: from oscar.core.loading import get_model [as 别名]
def __init__(self, **kwargs):
super(AdminProductChooser, self).__init__(**kwargs)
Product = get_model('catalogue', 'Product')
self.target_content_type = ContentType.objects.get_for_model(Product)
示例6: target_model
# 需要导入模块: from oscar.core import loading [as 别名]
# 或者: from oscar.core.loading import get_model [as 别名]
def target_model(self):
return get_model('catalogue', 'Product')
示例7: update_child_vouchers
# 需要导入模块: from oscar.core import loading [as 别名]
# 或者: from oscar.core.loading import get_model [as 别名]
def update_child_vouchers(voucher_id):
Voucher = get_model('voucher', 'Voucher')
parent = Voucher.objects.get(pk=voucher_id)
parent.update_children()
示例8: add_child_codes
# 需要导入模块: from oscar.core import loading [as 别名]
# 或者: from oscar.core.loading import get_model [as 别名]
def add_child_codes(voucher_id, child_count):
Voucher = get_model('voucher', 'Voucher')
parent = Voucher.objects.get(pk=voucher_id)
parent.create_children(child_count)
parent.save()