本文整理汇总了Python中anaf.core.models.ModuleSetting.set方法的典型用法代码示例。如果您正苦于以下问题:Python ModuleSetting.set方法的具体用法?Python ModuleSetting.set怎么用?Python ModuleSetting.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anaf.core.models.ModuleSetting
的用法示例。
在下文中一共展示了ModuleSetting.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from anaf.core.models import ModuleSetting [as 别名]
# 或者: from anaf.core.models.ModuleSetting import set [as 别名]
def setUp(self):
self.group, created = Group.objects.get_or_create(name='test')
self.user, created = DjangoUser.objects.get_or_create(username=self.username)
self.user.set_password(self.password)
self.user.save()
perspective, created = Perspective.objects.get_or_create(name='default')
perspective.set_default_user()
perspective.save()
ModuleSetting.set('default_perspective', perspective.id)
self.contact_type = ContactType(name='test')
self.contact_type.set_default_user()
self.contact_type.save()
self.contact = Contact(name='test', contact_type=self.contact_type)
self.contact.set_default_user()
self.contact.save()
self.category = Category(name='test')
self.category.set_default_user()
self.category.save()
self.equity = Equity(
issue_price=10, sell_price=10, issuer=self.contact, owner=self.contact)
self.equity.set_default_user()
self.equity.save()
self.asset = Asset(name='test', owner=self.contact)
self.asset.set_default_user()
self.asset.save()
self.tax = Tax(name='test', rate=10)
self.tax.set_default_user()
self.tax.save()
self.currency = Currency(code="GBP",
name="Pounds",
symbol="L",
is_default=True)
self.currency.set_default_user()
self.currency.save()
self.account = Account(
name='test', owner=self.contact, balance_currency=self.currency)
self.account.set_default_user()
self.account.save()
self.liability = Liability(name='test',
source=self.contact,
target=self.contact,
account=self.account,
value=10,
value_currency=self.currency)
self.liability.set_default_user()
self.liability.save()
self.transaction = Transaction(name='test', account=self.account, source=self.contact,
target=self.contact, value=10, value_currency=self.currency)
self.transaction.set_default_user()
self.transaction.save()
示例2: setUp
# 需要导入模块: from anaf.core.models import ModuleSetting [as 别名]
# 或者: from anaf.core.models.ModuleSetting import set [as 别名]
def setUp(self):
self.group = Group.objects.create(name='test')
self.user = DjangoUser.objects.create(username=self.username)
self.user.set_password(self.password)
self.user.save()
perspective = Perspective(name='default')
perspective.set_user(self.user.profile)
perspective.save()
ModuleSetting.set('default_perspective', perspective.id)
self.folder = Folder(name='test')
self.folder.set_user(self.user.profile)
self.folder.save()
self.document = Document(title='test_document', folder=self.folder)
self.document.set_user(self.user.profile)
self.document.save()
self.file = File(name='test_file', folder=self.folder)
self.file.set_user(self.user.profile)
self.file.save()
self.link = WebLink(title='test', folder=self.folder, url='test')
self.link.set_user(self.user.profile)
self.link.save()
示例3: setUp
# 需要导入模块: from anaf.core.models import ModuleSetting [as 别名]
# 或者: from anaf.core.models.ModuleSetting import set [as 别名]
def setUp(self):
self.group, created = Group.objects.get_or_create(name='test')
self.user, created = DjangoUser.objects.get_or_create(username=self.username)
self.user.set_password(self.password)
self.user.save()
self.perspective = Perspective(name='test')
self.perspective.set_default_user()
self.perspective.save()
ModuleSetting.set('default_perspective', self.perspective.id)
self.contact_type = ContactType()
self.contact_type.slug = 'machine'
self.contact_type.name = 'machine'
self.contact_type.save()
self.contact = Contact()
self.contact.contact_type = self.contact_type
self.contact.set_default_user()
self.contact.save()
self.assertNotEquals(self.contact.id, None)
self.status = SaleStatus()
self.status.active = True
self.status.use_sales = True
self.status.use_leads = True
self.status.use_opportunities = True
self.status.set_default_user()
self.status.save()
self.assertNotEquals(self.status.id, None)
self.currency = Currency(code="GBP",
name="Pounds",
symbol="L",
is_default=True)
self.currency.save()
self.source = SaleSource()
self.source.active = True
self.source.save()
self.source.set_user(self.user.profile)
self.assertNotEquals(self.source.id, None)
self.product = Product(name="Test")
self.product.product_type = 'service'
self.product.active = True
self.product.sell_price = 10
self.product.buy_price = 100
self.product.set_default_user()
self.product.save()
self.assertNotEquals(self.product.id, None)
self.subscription = Subscription()
self.subscription.client = self.contact
self.subscription.set_default_user()
self.subscription.save()
self.assertNotEquals(self.subscription.id, None)
self.lead = Lead()
self.lead.contact_method = 'email'
self.lead.status = self.status
self.lead.contact = self.contact
self.lead.set_default_user()
self.lead.save()
self.assertNotEquals(self.lead.id, None)
self.opportunity = Opportunity()
self.opportunity.lead = self.lead
self.opportunity.contact = self.contact
self.opportunity.status = self.status
self.opportunity.amount = 100
self.opportunity.amount_currency = self.currency
self.opportunity.amount_display = 120
self.opportunity.set_default_user()
self.opportunity.save()
self.assertNotEquals(self.opportunity.id, None)
self.order = SaleOrder(reference="Test")
self.order.opportunity = self.opportunity
self.order.status = self.status
self.order.source = self.source
self.order.currency = self.currency
self.order.total = 0
self.order.total_display = 0
self.order.set_default_user()
self.order.save()
self.assertNotEquals(self.order.id, None)
self.ordered_product = OrderedProduct()
self.ordered_product.product = self.product
self.ordered_product.order = self.order
self.ordered_product.rate = 0
self.ordered_product.subscription = self.subscription
self.ordered_product.set_default_user()
self.ordered_product.save()
self.assertNotEquals(self.ordered_product.id, None)