Module blaseball_mike.models.modification
Expand source code
from .base import Base
from .. import database
class Modification(Base):
"""Represents a player or team modification"""
@classmethod
def _get_fields(cls):
p = cls.load_one("FIREPROOF")
return [cls._from_api_conversion(x) for x in p.fields]
@classmethod
def load(cls, *ids):
return [cls(mod) for mod in database.get_attributes(list(ids))]
@classmethod
def load_one(cls, id_):
if id_ in (None, "NONE", ""):
return None
return cls.load(id_)[0]
Classes
class Modification (data, strict=False)
-
Represents a player or team modification
Expand source code
class Modification(Base): """Represents a player or team modification""" @classmethod def _get_fields(cls): p = cls.load_one("FIREPROOF") return [cls._from_api_conversion(x) for x in p.fields] @classmethod def load(cls, *ids): return [cls(mod) for mod in database.get_attributes(list(ids))] @classmethod def load_one(cls, id_): if id_ in (None, "NONE", ""): return None return cls.load(id_)[0]
Ancestors
- Base
- abc.ABC
Static methods
def load(*ids)
-
Expand source code
@classmethod def load(cls, *ids): return [cls(mod) for mod in database.get_attributes(list(ids))]
def load_one(id_)
-
Expand source code
@classmethod def load_one(cls, id_): if id_ in (None, "NONE", ""): return None return cls.load(id_)[0]
Instance variables
var background
var color
var description
var descriptions
var id
var text_color
var title