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


Python Person.find_by_fullname方法代码示例

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


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

示例1: test_find_members

# 需要导入模块: from person.models import Person [as 别名]
# 或者: from person.models.Person import find_by_fullname [as 别名]
 def test_find_members(self):
     person = Person.find_by_fullname('Diederik Samsom')
     member = ParliamentMember.find('Samsom', initials='D.M.')
     self.assertEqual(member.person, person)
     member = ParliamentMember.find('Samsom', initials='D.M.', date=datetime.date(year=2004, month=6, day=1))
     self.assertEqual(member.person, person)
     self.assertEqual(member.joined, datetime.date(year=2003, month=1, day=30))
     member = ParliamentMember.find('Samsom', initials='D.M.', date=datetime.date(year=2016, month=6, day=1))
     self.assertEqual(member.person, person)
     self.assertEqual(member.joined, datetime.date(year=2012, month=9, day=20))
开发者ID:openkamer,项目名称:openkamer,代码行数:12,代码来源:tests.py

示例2: test_get_member_for_person_at_date

# 需要导入模块: from person.models import Person [as 别名]
# 或者: from person.models.Person import find_by_fullname [as 别名]
 def test_get_member_for_person_at_date(self):
     person = Person.find_by_fullname('Diederik Samsom')
     members_all = ParliamentMember.objects.filter(person=person)
     self.assertEqual(members_all.count(), 4)
     members = ParliamentMember.find_at_date(person, datetime.date(year=2016, month=6, day=1))
     self.assertEqual(members[0].joined, datetime.date(year=2012, month=9, day=20))
     self.assertEqual(members.count(), 1)
     self.assertEqual(members[0].person, person)
     members = ParliamentMember.find_at_date(person, datetime.date(year=2004, month=6, day=1))
     self.assertEqual(members[0].joined, datetime.date(year=2003, month=1, day=30))
     self.assertEqual(members.count(), 1)
     self.assertEqual(members[0].person, person)
开发者ID:openkamer,项目名称:openkamer,代码行数:14,代码来源:tests.py

示例3: test_find_by_fullname

# 需要导入模块: from person.models import Person [as 别名]
# 或者: from person.models.Person import find_by_fullname [as 别名]
 def test_find_by_fullname(self):
     p_found = Person.find_by_fullname('Jan Peter Balkenende')
     self.assertEqual(self.p1, p_found)
     p_found = Person.find_by_fullname('Jan Balkenende')
     self.assertEqual(self.p2, p_found)
     p_found = Person.find_by_fullname('Jan van Balkenende')
     self.assertEqual(self.p3, p_found)
     p_found = Person.find_by_fullname('Jan Peter van Balkenende')
     self.assertEqual(self.p4, p_found)
     p_found = Person.find_by_fullname('Jan Jaap van Balkenende')
     self.assertEqual(None, p_found)
     p_found = Person.find_by_fullname('van Raak')
     self.assertEqual(self.p7, p_found)
开发者ID:openkamer,项目名称:openkamer,代码行数:15,代码来源:tests.py


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