Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何获取 Migration 模型 #1

Open
kycool opened this issue Nov 4, 2020 · 0 comments
Open

如何获取 Migration 模型 #1

kycool opened this issue Nov 4, 2020 · 0 comments

Comments

@kycool
Copy link
Owner

kycool commented Nov 4, 2020

from django.db.migrations.recorder import MigrationRecorder as f

In [6]: from django.db.migrations.recorder import MigrationRecorder as f

In [7]: f.Migration
Out[7]: django.db.migrations.recorder.MigrationRecorder.Migration.<locals>.Migration

In [8]: f.Migration.objects.all()
Out[8]: <QuerySet [<Migration: Migration 0001_initial for contenttypes>, <Migration: Migration 0002_remove_content_type_name for contenttypes>, <Migration: Migration 0001_initial for auth>, <Migration: Migration 0002_alter_permission_name_max_length for auth>, <Migration: Migration 0003_alter_user_email_max_length for auth>, <Migration: Migration 0004_alter_user_username_opts for auth>, <Migration: Migration 0005_alter_user_last_login_null for auth>, <Migration: Migration 0006_require_contenttypes_0002 for auth>, <Migration: Migration 0007_alter_validators_add_error_messages for auth>, <Migration: Migration 0008_alter_user_username_max_length for auth>, <Migration: Migration 0009_alter_user_last_name_max_length for auth>, <Migration: Migration 0010_alter_group_name_max_length for auth>, <Migration: Migration 0011_update_proxy_permissions for auth>, <Migration: Migration 0012_alter_user_first_name_max_length for auth>, <Migration: Migration 0001_initial for user>, <Migration: Migration 0001_initial for admin>, <Migration: Migration 0002_logentry_remove_auto_add for admin>, <Migration: Migration 0003_logentry_add_action_flag_choices for admin>, <Migration: Migration 0001_initial for sessions>, <Migration: Migration 0002_auto_20201022_1616 for user>, '...(remaining elements truncated)...']>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant