blob: 39dcf07051b7797a49dde9e7c54839620ea738f2 [file] [log] [blame]
Scott Baker2c3cb642014-05-19 17:55:56 -07001import os
2from django.db import models
Scott Bakereef5a6b2014-12-19 16:41:12 -08003from core.models import PlCoreBase, Controller
4from core.models.site import ControllerLinkManager, ControllerLinkDeletionManager
Scott Baker2c3cb642014-05-19 17:55:56 -07005from django.contrib.contenttypes import generic
6
7class DashboardView(PlCoreBase):
8 name = models.CharField(max_length=200, unique=True, help_text="Name of the View")
9 url = models.CharField(max_length=1024, help_text="URL of Dashboard")
Scott Baker75930d82014-12-22 17:43:25 -080010 controllers = models.ManyToManyField(Controller, blank=True, related_name="dashboardviews", through='ControllerDashboardView')
Scott Bakerb8f3cab2015-01-18 16:33:30 -080011 enabled = models.BooleanField(default=True)
Scott Baker2c3cb642014-05-19 17:55:56 -070012
13 def __unicode__(self): return u'%s' % (self.name)
14
Scott Bakera6a0c772014-12-22 17:35:34 -080015class ControllerDashboardView(PlCoreBase):
Scott Bakereef5a6b2014-12-19 16:41:12 -080016 objects = ControllerLinkManager()
17 deleted_objects = ControllerLinkDeletionManager()
Scott Bakerf0f50732014-12-23 09:39:06 -080018 controller = models.ForeignKey(Controller, related_name='controllerdashboardviews')
19 dashboardView = models.ForeignKey(DashboardView, related_name='controllerdashboardviews')
Scott Bakerb8f3cab2015-01-18 16:33:30 -080020 enabled = models.BooleanField(default=True)
Scott Bakereef5a6b2014-12-19 16:41:12 -080021
22 url = models.CharField(max_length=1024, help_text="URL of Dashboard")
23
24
25