📜  django 模型得到所有 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:40.245000             🧑  作者: Mango

代码示例2
import django.apps
django.apps.apps.get_models()  #uses django lib to show models in your Django App

#Sample Output:
[django.contrib.admin.models.LogEntry,
 django.contrib.auth.models.Permission,
 django.contrib.auth.models.Group,
 django.contrib.auth.models.User,
 django.contrib.contenttypes.models.ContentType,
 django.contrib.sessions.models.Session,
 myApp.models.myModel]