add created_at field for ip information

This commit is contained in:
2024-04-13 00:31:02 +02:00
parent a19f37858f
commit 0e9221db24
@@ -18,6 +18,7 @@ def get_contact_list() -> list:
_contact = ContactPojo(first_name=item.first_name, last_name=item.last_name, mail=item.mail,
phone_number=item.phone, passport_number=item.passport, store=item.store)
_contact.ip_address = item.ip_address
_contact.created_at = item.created_at
_contact_list.append(_contact)
return _contact_list
@@ -39,7 +40,7 @@ def write_contact_with_ip_info_to_file(contact_list):
col = 0
# Create a workbook and add a worksheet.
workbook = xlsxwriter.Workbook('ip_info_{}.xlsx'.format(len(contact_list)))
header_data = ['name', 'email', 'isp', 'ip_address']
header_data = ['name', 'email', 'isp', 'ip_address', 'created_at']
worksheet = workbook.add_worksheet()
header_format = workbook.add_format({'bold': True})
@@ -52,6 +53,7 @@ def write_contact_with_ip_info_to_file(contact_list):
worksheet.write(row, col + 1, info.mail)
worksheet.write(row, col + 2, info.isp)
worksheet.write(row, col + 3, info.ip_address)
worksheet.write(row, col + 4, info.created_at)
row += 1
workbook.close()