enums.py 677 Bytes
class Table:
  id = "id"
  path = "path"
  serv = "serv"
  dest = "dest"
  type = "type"
  state = "state"

  @staticmethod
  def validate(column):
    return hasattr(Table, column)

class States:
  queued = "queued"
  delivered = "delivered"
  preprocess = "preprocess"

  @staticmethod
  def validate(state):
    return hasattr(States, state)

class Services:
  wpp1 = "wpp1"
  mail = "mail"

  @staticmethod
  def validate(serv):
    return hasattr(Services, serv)

class Datatypes:
  text = "text"
  image = "image"
  document = "document"
  link = "link"
  audio = "audio"
  html = "html"

  @staticmethod
  def validate(datatype):
    return hasattr(Datatypes, datatype)