add created_at field for ip information
This commit is contained in:
@@ -18,6 +18,7 @@ def get_contact_list() -> list:
|
|||||||
_contact = ContactPojo(first_name=item.first_name, last_name=item.last_name, mail=item.mail,
|
_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)
|
phone_number=item.phone, passport_number=item.passport, store=item.store)
|
||||||
_contact.ip_address = item.ip_address
|
_contact.ip_address = item.ip_address
|
||||||
|
_contact.created_at = item.created_at
|
||||||
_contact_list.append(_contact)
|
_contact_list.append(_contact)
|
||||||
return _contact_list
|
return _contact_list
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ def write_contact_with_ip_info_to_file(contact_list):
|
|||||||
col = 0
|
col = 0
|
||||||
# Create a workbook and add a worksheet.
|
# Create a workbook and add a worksheet.
|
||||||
workbook = xlsxwriter.Workbook('ip_info_{}.xlsx'.format(len(contact_list)))
|
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()
|
worksheet = workbook.add_worksheet()
|
||||||
header_format = workbook.add_format({'bold': True})
|
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 + 1, info.mail)
|
||||||
worksheet.write(row, col + 2, info.isp)
|
worksheet.write(row, col + 2, info.isp)
|
||||||
worksheet.write(row, col + 3, info.ip_address)
|
worksheet.write(row, col + 3, info.ip_address)
|
||||||
|
worksheet.write(row, col + 4, info.created_at)
|
||||||
row += 1
|
row += 1
|
||||||
workbook.close()
|
workbook.close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user