Проверка шаблона шины для iOS
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

generateModelFields.py 621B

11 个月前
10 个月前
11 个月前
10 个月前
11 个月前
1234567891011121314151617181920
  1. from generation.fieldFormat import *
  2. def generateModelFields(c):
  3. fileName = f"{c.dir}/templates/model-field"
  4. lines = c.readFile(fileName)
  5. fmtPlain = lines[0]
  6. fmtRecent = lines[1]
  7. fmtMany = lines[2]
  8. fields = []
  9. for key in c.structure.model.fields:
  10. values = c.structure.model.fields[key]
  11. fmt = fieldFormat(fmtMany, fmtPlain, fmtRecent, key, c.structure)
  12. ln = fmt \
  13. .replace("%NAME%", key) \
  14. .replace("%TYPE%", values[0]) \
  15. .replace("%DEFAULT%", values[1])
  16. fields.append(ln)
  17. c.modelFields = "\n".join(fields)