📫
Automail
  • Introduction
  • Installation
    • Local DEV
    • Containerized PROD
    • Windows PROD
  • Repository
  • Architecture
  • Configurations
    • Settings
    • UI Configuration
      • Site
        • Selectpickers
          • Filter
          • Tokenfield
        • Panels
          • ChartJS
          • Amcharts
          • Table
          • Regular Table
          • Metrics
          • Gallery
          • LeafletMap
          • Itemlist
          • Card
          • Downloads
      • Admin
    • Workflow Configuration
      • Sync Workflows
        • Autoform Nav Elements
      • Custom Workflows
      • Dags
Powered by GitBook
On this page
  1. Configurations
  2. UI Configuration
  3. Site
  4. Panels

Downloads

Below is an example configuration of a panel using the Downloads module:

{
    "label": "Downloads",
    "icon": "mdi mdi-download",
    "url_name": "grid_downloader",
    "allowed_user_groups": [],
    "allowed_users": [],
},

The grid_downloader is defined in polygon/apps/app_download/urls.py

urlpatterns = [
    get_url(
        url_name="grid_downloader",
        view=controller_views.GridView,
        view_params={
            "title": "Downloads",
            "panels": [
                {
                    "full_row": True,
                    "title": "Files to Download",
                    "width": 12,
                    "url_name": "frame_regular_table",
                    "url_action_name": "panel_downloader",
                },
            ],
        },
    ),
]

urlpatterns += [
    get_url(
        url_name="panel_downloader",
        view=module_views.RegularTable,
        view_params={
            "model": models.FileDownloader,
            "order_by": "-file_creation_dt",
            "apply_js": True,
            "field_definitions": {
                "file_creation_dt": {
                    "label": "Timestamp",
                    "format": "datetime",
                },
                "label": {
                    "label": "Report Name",
                },
                "category": {
                    "label": "Report Category",
                },
                "download_config": {
                    "label": "Download",
                    "format": "url_button",
                },
            },
            "include_filters_extra": {
                "is_active": True,
                "file_extension__in": ["xlsx", "csv", "pdf", "json", "zip"],
            },
        },
    ),
]
PreviousCardNextAdmin

Last updated 7 months ago