def make_fake_dashboard(name='Random chart', max_charts=10):
"""Generate fake dashboard data with a specific number of random charts.
Args:
name (str): The name of the new dashboard (default: {'Random chart'})
max_charts (int): Max number of charts to make (default: {10})
Returns:
dict: The chart configuration.
"""
charts = ImmutableMultiDict([
make_fake_chart_data() for _ in range(max_charts)]
)
return dict(
name=name,
created_by='global',
date=dt.now(),
category=choice(settings.CHARTS_CONFIG.keys()),
modules=db.format_charts(charts),
id=str(uuid1()),
layout='freeform',
)
评论列表
文章目录