Last active
September 1, 2021 13:21
-
-
Save thiagoferreiraw/24fb39109ff64e648032b1e07dd98938 to your computer and use it in GitHub Desktop.
Medium - Metabase + Django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ReportEngine(BaseModel, models.Model): | |
id = HashedAutoField(primary_key=True) | |
name = models.CharField(max_length=250) | |
type = models.CharField( | |
choices=(("metabase", "Metabase"),), default="metabase", max_length=50 | |
) | |
base_url = models.URLField() | |
integration_api_key = models.CharField(max_length=250) | |
class EmbeddedReport(BaseModel, models.Model): | |
id = HashedAutoField(primary_key=True) | |
name = models.CharField(max_length=250) | |
engine = models.ForeignKey(ReportEngine, on_delete=models.PROTECT) | |
reference_id = models.CharField( | |
help_text="Report ID on the engine, like question id, dashboard id on Metabase", | |
max_length=50, | |
) | |
reference_type = models.CharField( | |
choices=( | |
("single_report", "Question/Single Report"), | |
("dashboard", "Dashboard"), | |
), | |
max_length=50, | |
) | |
active = models.BooleanField(default=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment