Let's say I have 10 records on my database and I want to render all of them in my Dash web app, is there a way where I can render all of them through a for loop? I've tried creating a function that renders the element but when I try to iterate through the records it only renders the first one.
x = ['Tom', 'Jerry', 'Math']
def createRegister(name):
return dbc.Col([
html.P(f"{name}")
])
app.layout = dbc.Container([
dcc.Interval(id='interval_db', interval=86400000 * 7, n_intervals=0),
dbc.Row([
], id='row-teste')
], fluid=True)
@app.callback(
Output('row-teste', 'children'),
[Input('interval_db', 'n_intervals')]
)
def p(n_intervals):
for i in x:
return createReg(i)
What am I doing wrong here?