19 lines
538 B
Python
19 lines
538 B
Python
|
|
import discord
|
||
|
|
|
||
|
|
from libs.View import View
|
||
|
|
from data.models.Framework import Framework
|
||
|
|
from libs.FrameworkButton import FrameworkButton
|
||
|
|
|
||
|
|
class FrameworkButtons(View):
|
||
|
|
|
||
|
|
def __init__(self, bot):
|
||
|
|
self.bot = bot
|
||
|
|
super().__init__()
|
||
|
|
|
||
|
|
def get_buttons(self):
|
||
|
|
frameworks = self.bot.db.session.query(Framework).all()
|
||
|
|
|
||
|
|
for framework in frameworks:
|
||
|
|
btn = FrameworkButton(label=framework.label, language_role=framework.language.label)
|
||
|
|
self.buttons.append(btn)
|
||
|
|
return self.buttons
|