typeBadges = (f, req) => {
  let s = "";
  if (f.primary_key) s += badge("warning", req.__("Primary key"));
  if (f.required) s += badge("primary", req.__("Required"));
  if (f.is_unique) s += badge("success", req.__("Unique"));
  if (f.calculated)
    s += badge(
      "info",
      req.__("Calculated"),
      f.expression && f.expression !== "__aggregation"
        ? text_attr(f.expression)
        : undefined
    );
  if (f.stored) s += badge("warning", req.__("Stored"));
  return s;
}
@param {object} f
@param {object} req
@returns {string}