Advertisement
ivandev

Untitled

Jan 11th, 2021
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
  2.  
  3. from keyboards.inline.callback_data import choose_window_callback
  4. from loader import loop
  5. from utils.db_api.db_commands import select_all_windows
  6.  
  7. windows = select_all_windows()
  8. windows = loop.run_until_complete(windows)
  9.  
  10. choose_window = InlineKeyboardMarkup(row_width=1)
  11. for window in windows:
  12.     choose_window.insert(InlineKeyboardButton(text=f"{window.date}\n{window._from}-{window._to}",
  13.                                               callback_data=choose_window_callback.new(window.id)))
  14.  
  15.  
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement