当前位置: 首页>>代码示例>>Python>>正文


Python CityLocation.get_default方法代码示例

本文整理汇总了Python中stoqlib.domain.address.CityLocation.get_default方法的典型用法代码示例。如果您正苦于以下问题:Python CityLocation.get_default方法的具体用法?Python CityLocation.get_default怎么用?Python CityLocation.get_default使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在stoqlib.domain.address.CityLocation的用法示例。


在下文中一共展示了CityLocation.get_default方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testGetDefault

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
 def testGetDefault(self):
     location = CityLocation.get_default(self.store)
     self.failUnless(isinstance(location, CityLocation))
     self.assertEquals(location.city,
                       sysparam(self.store).CITY_SUGGESTED)
     self.assertEquals(location.state,
                       sysparam(self.store).STATE_SUGGESTED)
     self.assertEquals(location.country,
                       sysparam(self.store).COUNTRY_SUGGESTED)
开发者ID:romaia,项目名称:stoq,代码行数:11,代码来源:test_address.py

示例2: __init__

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
    def __init__(self, target, store):
        AttributeForwarder.__init__(self, target)
        self.store = store
        if not target.birth_location:
            target.birth_location = CityLocation.get_default(store)

        self.city = target.birth_location.city
        self.state = target.birth_location.state
        self.country = target.birth_location.country
开发者ID:romaia,项目名称:stoq,代码行数:11,代码来源:individualtemplate.py

示例3: test_get_default

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
 def test_get_default(self):
     location = CityLocation.get_default(self.store)
     self.failUnless(isinstance(location, CityLocation))
     self.assertEquals(location.city,
                       sysparam.get_string('CITY_SUGGESTED'))
     self.assertEquals(location.state,
                       sysparam.get_string('STATE_SUGGESTED'))
     self.assertEquals(location.country,
                       sysparam.get_string('COUNTRY_SUGGESTED'))
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:11,代码来源:test_address.py

示例4: _create_address

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
    def _create_address(self, person, street, streetnumber, postal_code):
        city = CityLocation.get_default(self.store)

        return Address(store=self.store,
                       street=street,
                       streetnumber=streetnumber,
                       postal_code=postal_code,
                       is_main_address=True,
                       person=person,
                       city_location=city)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:12,代码来源:test_nfe.py

示例5: __init__

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
    def __init__(self, target, store):
        """
        :param model: an Individial
        :param store: a store
        """
        AttributeForwarder.__init__(self, target)
        self.store = store
        if not target.birth_location:
            target.birth_location = CityLocation.get_default(store)

        self.city = target.birth_location.city
        self.state = target.birth_location.state
        self.country = target.birth_location.country
开发者ID:LeonamSilva,项目名称:stoq,代码行数:15,代码来源:individualtemplate.py

示例6: _create_client

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
    def _create_client(self, store):
        from stoqlib.domain.address import Address, CityLocation
        from stoqlib.domain.person import Client, Person

        person = Person(name=u'Person', store=store)
        city = CityLocation.get_default(store)
        Address(store=store,
                street=u'Rua Principal',
                streetnumber=123,
                postal_code=u'12345-678',
                is_main_address=True,
                person=person,
                city_location=city)
        client = Client(person=person, store=store)
        client.credit_limit = currency("1000")
        return client
开发者ID:amaurihamasu,项目名称:stoq,代码行数:18,代码来源:test_pos.py

示例7: __init__

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
    def __init__(self, target, store, ui_form_name=None):
        """
        :param target: an Individial
        :param store: a store
        """
        # Even though we dont use ui_form_name anywhere in this class, its setup
        # is made in a way we need this argument. see persontemplate
        # attach_model_slave method
        AttributeForwarder.__init__(self, target)
        self.store = store
        if not target.birth_location:
            target.birth_location = CityLocation.get_default(store)

        self.city = target.birth_location.city
        self.state = target.birth_location.state
        self.country = target.birth_location.country
开发者ID:hackedbellini,项目名称:stoq,代码行数:18,代码来源:individualtemplate.py

示例8: create_model

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
 def create_model(self, store):
     address = Address(person=self.person,
                       city_location=CityLocation.get_default(store),
                       is_main_address=self.is_main_address,
                       store=store)
     return _AddressModel(address, store)
开发者ID:hackedbellini,项目名称:stoq,代码行数:8,代码来源:addressslave.py

示例9: test_location_suggested

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
 def test_location_suggested(self):
     location = CityLocation.get_default(self.store)
     self.assertEqual(location.city, self.sparam.get_string('CITY_SUGGESTED'))
     self.assertEqual(location.state, self.sparam.get_string('STATE_SUGGESTED'))
     self.assertEqual(location.country, self.sparam.get_string('COUNTRY_SUGGESTED'))
开发者ID:Guillon88,项目名称:stoq,代码行数:7,代码来源:test_parameters.py

示例10: testLocationSuggested

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
 def testLocationSuggested(self):
     location = CityLocation.get_default(self.store)
     self.assertEqual(location.city, self.sparam.CITY_SUGGESTED)
     self.assertEqual(location.state, self.sparam.STATE_SUGGESTED)
     self.assertEqual(location.country, self.sparam.COUNTRY_SUGGESTED)
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:test_parameters.py

示例11: create_model

# 需要导入模块: from stoqlib.domain.address import CityLocation [as 别名]
# 或者: from stoqlib.domain.address.CityLocation import get_default [as 别名]
 def create_model(self, store):
     return Address(person=self.person,
                    city_location=CityLocation.get_default(store),
                    is_main_address=False,
                    store=store)
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:7,代码来源:addresseditor.py


注:本文中的stoqlib.domain.address.CityLocation.get_default方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。