creating django model for existing database/sql view?

前端 未结 2 447
挽巷
挽巷 2021-02-04 16:21

I have inserted a definition for a view in $template_dir/sql/$someTableName.sql file. (create or replace view) so every time I run syncdb, the db views are created.

2条回答
  •  遥遥无期
    2021-02-04 17:03

    Try to use python manage.py inspectdb or python manage.py inspectdb > models.py

提交回复
热议问题