from models.tg_phone_devices import TgPhoneDevices1, TgPhoneDevices

if __name__ == '__main__':
    for i in TgPhoneDevices1.select():
        tg_info = TgPhoneDevices.get_or_none(
            phone=i.phone,
        )

        i.port = tg_info.port
        i.save()
