本文整理匯總了Python中cyder.cydns.address_record.models.AddressRecord.__repr__方法的典型用法代碼示例。如果您正苦於以下問題:Python AddressRecord.__repr__方法的具體用法?Python AddressRecord.__repr__怎麽用?Python AddressRecord.__repr__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cyder.cydns.address_record.models.AddressRecord
的用法示例。
在下文中一共展示了AddressRecord.__repr__方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: do_add_record6
# 需要導入模塊: from cyder.cydns.address_record.models import AddressRecord [as 別名]
# 或者: from cyder.cydns.address_record.models.AddressRecord import __repr__ [as 別名]
def do_add_record6(self, data):
rec = AddressRecord(label = data['label'], domain=data['domain'], ip_str=data['ip'], ip_type='6')
rec.save()
self.assertTrue(rec.__repr__())
self.assertTrue(rec.get_absolute_url())
self.assertTrue(rec.get_edit_url())
self.assertTrue(rec.get_delete_url())
self.assertTrue(rec.details())
示例2: do_add_record
# 需要導入模塊: from cyder.cydns.address_record.models import AddressRecord [as 別名]
# 或者: from cyder.cydns.address_record.models.AddressRecord import __repr__ [as 別名]
def do_add_record(self, data):
rec = AddressRecord(label=data['label'], domain=data['domain'],
ip_str=data['ip'], ip_type='4')
rec.save()
self.assertTrue(rec.__repr__())
self.assertTrue(rec.details())
search = AddressRecord.objects.filter(label=data['label'],
domain=data['domain'], ip_type='4', ip_str=data['ip'])
found = False
for record in search:
if record.ip_str == data['ip']:
found = True
self.assertTrue(found)
return rec