查模型的列名:

select column_name from information_schema.columns  where table_name= 'your_table';

应用:

1. 给django的模型自动生成模板:

select '<tr><td><b>'||replace(column_name,'_',' ')||'</b></td><td>{{form.'||column_name||'}}</td></tr>' from information_schema.columns  where table_name= 'eForm_request_form';

相关文章:

  • 2022-12-23
  • 2021-12-25
  • 2021-08-06
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
猜你喜欢
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案