from models.tg_models import TelegramAccountMumu from models.tg_phone_devices import TgPhoneDevices if __name__ == '__main__': tg_mumu_infos = TelegramAccountMumu.select().where( TelegramAccountMumu.server_id == "192.168.50.77" ) for tg_mumu_info in tg_mumu_infos: tg_phone_info = TgPhoneDevices.get_or_none( # TgPhoneDevices.server_ip == "192.168.50.58", TgPhoneDevices.phone == tg_mumu_info.ld_name ) print(f"192.168.50.220|{tg_phone_info.port}||||{tg_mumu_info.index_id}|")