Skip to content

Conversation

@drkane
Copy link
Contributor

@drkane drkane commented Apr 14, 2023

This adds a number of new fields to the dashboard query object, to meet some of the needs described in issue #141.

The new fields are:

  • title - a title for the query - by default this is displayed above it
  • description - markdown description of the query - displayed between the title and the query results
  • created_at - date the query was created, to match the Dashboard object.
  • template - a space where the user can specify the template they want to use. This is searched for in django_sql_dashboard/widgets/XXXX.html in the same way as it is done when looking for a template based on a column name. This allows for greater flexibility than only using the column names to select
  • settings - a json field which is passed to the template and could be used to customise the display of the widget. The use-cases I envisage for this include being able to size your widgets into a masonry-type layout, and customising a chart design.

At the moment the new fields are only editable through the admin interface, and they are all optional. So the default user experience for creating a dashboard is unaffected. The template name goes through django's standard template lookup so it should use the default template if it can't find the one specified.

NB this also removes support for Python 3.6 and Postgres 10 and 11 (due to those failing in github actions) and adds support for python 3.11 and postgres 14 and 15. It also fixes an error in the test_html_widget test where it was testing the markdown template instead of the html one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant