def __init__(self, dashboard, data):
    self.dashboard = dashboard
    self.admin_site = dashboard.admin_site
    self.request = dashboard.request
    self.user = dashboard.request.user
    self.convert(data)
    super(BaseWidget, self).__init__(data)
    if (not self.is_valid()):
        raise WidgetDataError(self, self.errors.as_text())
    self.setup()
def __init__(self, dashboard, data):
    self.dashboard = dashboard
    self.admin_site = dashboard.admin_site
    self.request = dashboard.request
    self.user = dashboard.request.user
    self.convert(data)
    super(BaseWidget, self).__init__(data)
    if (not self.is_valid()):
        raise WidgetDataError(self, self.errors.as_text())
    self.setup()