stashboard/models.py
def rest(self, base_url):
        """ Return a Python object representing this model"""

        m = {}
        m["default"] = self.default
        m["name"] = unicode(self.name)
        m["id"] = unicode(self.slug)
        m["description"] = unicode(self.description)
        m["url"] = base_url + self.resource_url()
        o = urlparse.urlparse(base_url)
        m["image"] = o.scheme + "://" +  o.netloc + self.image_url()

        # Maintain v1 requirement
        if self.severity == 30:
            m["level"] = "WARNING"
        elif self.severity == 40:
            m["level"] = "ERROR"
        elif self.severity == 50:
            m["level"] = "CRITICAL"
        else:
            m["level"] = "NORMAL"

        return m
 Return a Python object representing this model
Return a Python object representing this model
Return a Python object representing this model
def rest(self, base_url):
        m = {}
        m["default"] = self.default
        m["name"] = unicode(self.name)
        m["id"] = unicode(self.slug)
        m["description"] = unicode(self.description)
        m["url"] = base_url + self.resource_url()
        o = urlparse.urlparse(base_url)
        m["image"] = o.scheme + "://" +  o.netloc + self.image_url()
        if self.severity == 30:
            m["level"] = "WARNING"
        elif self.severity == 40:
            m["level"] = "ERROR"
        elif self.severity == 50:
            m["level"] = "CRITICAL"
        else:
            m["level"] = "NORMAL"
        return m
def rest ( self , base_url ) : m = { } m [ "default" ] = self . default m [ "name" ] = unicode ( self . name ) m [ "id" ] = unicode ( self . slug ) m [ "description" ] = unicode ( self . description ) m [ "url" ] = base_url + self . resource_url ( ) o = urlparse . urlparse ( base_url ) m [ "image" ] = o . scheme + "://" + o . netloc + self . image_url ( ) if self . severity == 30 : m [ "level" ] = "WARNING" elif self . severity == 40 : m [ "level" ] = "ERROR" elif self . severity == 50 : m [ "level" ] = "CRITICAL" else : m [ "level" ] = "NORMAL" return m
Return a Python object representing this model
Return a Python object representing this model
""" Return a Python object representing this model""" # Maintain v1 requirement
self
base_url