blob: 18f47f31e2947118fc8e49fcf297adbb66df0a40 [file] [log] [blame]
Scott Baker2c3cb642014-05-19 17:55:56 -07001import os
2from django.db import models
Scott Baker786a9c12014-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 Bakerf2c0c512014-12-22 17:35:34 -080010 controllers = models.ManyToManyField(Controller, blank=True, related_name="dashboardViews", through='ControllerDashboardView')
Scott Baker2c3cb642014-05-19 17:55:56 -070011
12 def __unicode__(self): return u'%s' % (self.name)
13
Scott Bakerf2c0c512014-12-22 17:35:34 -080014class ControllerDashboardView(PlCoreBase):
Scott Baker786a9c12014-12-19 16:41:12 -080015 objects = ControllerLinkManager()
16 deleted_objects = ControllerLinkDeletionManager()
Scott Bakerf2c0c512014-12-22 17:35:34 -080017 controller = models.ForeignKey(Controller, related_name='controllerdashboardViews')
18 dashboardView = models.ForeignKey(DashboardView, related_name='controllerdashboardViews')
Scott Baker786a9c12014-12-19 16:41:12 -080019
20 url = models.CharField(max_length=1024, help_text="URL of Dashboard")
21
22
23