【Django】如何转化已有的数据表到Django模型--20230823
初步生成model.py
$ python manage.py inspectdb
$ python manage.py inspectdb > models.py
python manage.py inspectdb
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from django.db import modelsclass AuthGroup(models.Model):name = models.CharField(unique=True, max_length=150)class Meta:managed = Falsedb_table = 'auth_group'class AuthGroupPermissions(models.Model):id = models.BigAutoField(primary_key=True)group = models.ForeignKey(AuthGroup, models.DO_NOTHING)permission = models.ForeignKey('AuthPermission', models.DO_NOTHING)class Meta:managed = Falsedb_table = 'auth_group_permissions'unique_together = (('group', 'permission'),)class AuthPermission(models.Model):name = models.CharField(max_length=255)content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING)codename = models.CharField(max_length=100)class Meta:managed = Falsedb_table = 'auth_permission'unique_together = (('content_type', 'codename'),)class AuthUser(models.Model):password = models.CharField(max_length=128)last_login = models.DateTimeField(blank=True, null=True)is_superuser = models.IntegerField()username = models.CharField(unique=True, max_length=150)first_name = models.CharField(max_length=150)last_name = models.CharField(max_length=150)email = models.CharField(max_length=254)is_staff = models.IntegerField()is_active = models.IntegerField()date_joined = models.DateTimeField()class Meta:managed = Falsedb_table = 'auth_user'class AuthUserGroups(models.Model):id = models.BigAutoField(primary_key=True)user = models.ForeignKey(AuthUser, models.DO_NOTHING)group = models.ForeignKey(AuthGroup, models.DO_NOTHING)class Meta:managed = Falsedb_table = 'auth_user_groups'unique_together = (('user', 'group'),)class AuthUserUserPermissions(models.Model):id = models.BigAutoField(primary_key=True)user = models.ForeignKey(AuthUser, models.DO_NOTHING)permission = models.ForeignKey(AuthPermission, models.DO_NOTHING)class Meta:managed = Falsedb_table = 'auth_user_user_permissions'unique_together = (('user', 'permission'),)class Config(models.Model):id = models.BigAutoField(primary_key=True)config1 = models.CharField(max_length=135, blank=True, null=True)config2 = models.CharField(max_length=135, blank=True, null=True)config3 = models.CharField(max_length=135, blank=True, null=True)config4 = models.CharField(max_length=135, blank=True, null=True)config5 = models.CharField(max_length=135, blank=True, null=True)config6 = models.CharField(max_length=135, blank=True, null=True)config7 = models.CharField(max_length=135, blank=True, null=True)config8 = models.CharField(max_length=135, blank=True, null=True)config9 = models.CharField(max_length=135, blank=True, null=True)config10 = models.CharField(max_length=135, blank=True, null=True)config11 = models.CharField(max_length=135, blank=True, null=True)config12 = models.CharField(max_length=135, blank=True, null=True)config13 = models.CharField(max_length=135, blank=True, null=True)config14 = models.CharField(max_length=135, blank=True, null=True)config15 = models.CharField(max_length=135, blank=True, null=True)config16 = models.CharField(max_length=135, blank=True, null=True)config17 = models.CharField(max_length=135, blank=True, null=True)config18 = models.CharField(max_length=135, blank=True, null=True)config19 = models.CharField(max_length=135, blank=True, null=True)config20 = models.CharField(max_length=135, blank=True, null=True)config21 = models.CharField(max_length=135, blank=True, null=True)config22 = models.CharField(max_length=135, blank=True, null=True)config23 = models.CharField(max_length=135, blank=True, null=True)config24 = models.CharField(max_length=135, blank=True, null=True)config25 = models.CharField(max_length=135, blank=True, null=True)config26 = models.CharField(max_length=135, blank=True, null=True)config27 = models.CharField(max_length=135, blank=True, null=True)config28 = models.CharField(max_length=135, blank=True, null=True)config29 = models.CharField(max_length=135, blank=True, null=True)config30 = models.CharField(max_length=135, blank=True, null=True)config31 = models.CharField(max_length=135, blank=True, null=True)config32 = models.CharField(max_length=135, blank=True, null=True)config33 = models.CharField(max_length=135, blank=True, null=True)config34 = models.CharField(max_length=135, blank=True, null=True)config35 = models.CharField(max_length=135, blank=True, null=True)config36 = models.CharField(max_length=135, blank=True, null=True)config37 = models.CharField(max_length=135, blank=True, null=True)config38 = models.CharField(max_length=135, blank=True, null=True)config39 = models.CharField(max_length=135, blank=True, null=True)config40 = models.CharField(max_length=135, blank=True, null=True)config41 = models.CharField(max_length=135, blank=True, null=True)config42 = models.CharField(max_length=135, blank=True, null=True)config43 = models.CharField(max_length=135, blank=True, null=True)config44 = models.CharField(max_length=135, blank=True, null=True)config45 = models.CharField(max_length=135, blank=True, null=True)config46 = models.CharField(max_length=135, blank=True, null=True)config47 = models.CharField(max_length=135, blank=True, null=True)config48 = models.CharField(max_length=135, blank=True, null=True)config49 = models.CharField(max_length=135, blank=True, null=True)config50 = models.CharField(max_length=135, blank=True, null=True)class Meta:managed = Falsedb_table = 'config'class CsodTrainingAndTestRecord2(models.Model):id = models.BigAutoField(primary_key=True)user = models.CharField(db_column='USER', max_length=135, blank=True, null=True) # Field name made lowercase.user_id = models.CharField(db_column='USER_ID', max_length=135, blank=True, null=True) # Field name made lowercase.training_title = models.CharField(db_column='TRAINING_TITLE', max_length=135, blank=True, null=True) # Field name made lowercase.training_version = models.CharField(db_column='TRAINING_VERSION', max_length=135, blank=True, null=True) # Field name made lowercase.training_type = models.CharField(db_column='TRAINING_TYPE', max_length=135, blank=True, null=True) # Field name made lowercase.training_vendor = models.CharField(db_column='TRAINING_VENDOR', max_length=135, blank=True, null=True) # Field name made lowercase.training_status = models.CharField(db_column='TRAINING_STATUS', max_length=135, blank=True, null=True) # Field name made lowercase.training_hours = models.CharField(db_column='TRAINING_HOURS', max_length=135, blank=True, null=True) # Field name made lowercase.credits = models.CharField(db_column='CREDITS', max_length=135, blank=True, null=True) # Field name made lowercase.training_record_date = models.DateTimeField(db_column='TRAINING_RECORD_DATE', blank=True, null=True) # Field name made lowercase.accommodation_expense = models.CharField(db_column='Accommodation_Expense', max_length=135, blank=True, null=True) # Field name made lowercase.apply_reason = models.CharField(db_column='Apply_Reason', max_length=135, blank=True, null=True) # Field name made lowercase.compulsory_elective = models.CharField(db_column='Compulsory_Elective', max_length=135, blank=True, null=True) # Field name made lowercase.course_owner = models.CharField(db_column='Course_Owner', max_length=135, blank=True, null=True) # Field name made lowercase.currency = models.CharField(db_column='Currency', max_length=135, blank=True, null=True) # Field name made lowercase.facility_expense = models.CharField(db_column='Facility_Expense', max_length=135, blank=True, null=True) # Field name made lowercase.instructor_expense = models.CharField(db_column='Instructor_Expense', max_length=135, blank=True, null=True) # Field name made lowercase.instructor_full_name = models.CharField(db_column='Instructor_Full_Name', max_length=135, blank=True, null=True) # Field name made lowercase.instructor_id = models.CharField(db_column='Instructor_ID', max_length=135, blank=True, null=True) # Field name made lowercase.instructor_type = models.CharField(db_column='Instructor_Type', max_length=135, blank=True, null=True) # Field name made lowercase.material_expense = models.CharField(db_column='Material_Expense', max_length=135, blank=True, null=True) # Field name made lowercase.meal_expense = models.CharField(db_column='Meal_Expense', max_length=135, blank=True, null=True) # Field name made lowercase.note = models.CharField(db_column='Note', max_length=135, blank=True, null=True) # Field name made lowercase.other_expense = models.CharField(db_column='Other_Expense', max_length=135, blank=True, null=True) # Field name made lowercase.training_type_2 = models.CharField(db_column='Training_Type_2', max_length=135, blank=True, null=True) # Field name made lowercase.transportation_expense = models.CharField(db_column='Transportation_Expense', max_length=135, blank=True, null=True) # Field name made lowercase.unfinished_training_fee = models.CharField(db_column='Unfinished_Training_Fee', max_length=135, blank=True, null=True) # Field name made lowercase.class Meta:managed = Falsedb_table = 'csod_training_and_test_record2'class DjangoAdminLog(models.Model):action_time = models.DateTimeField()object_id = models.TextField(blank=True, null=True)object_repr = models.CharField(max_length=200)action_flag = models.PositiveSmallIntegerField()change_message = models.TextField()content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING, blank=True, null=True)user = models.ForeignKey(AuthUser, models.DO_NOTHING)class Meta:managed = Falsedb_table = 'django_admin_log'class DjangoContentType(models.Model):app_label = models.CharField(max_length=100)model = models.CharField(max_length=100)class Meta:managed = Falsedb_table = 'django_content_type'unique_together = (('app_label', 'model'),)class DjangoMigrations(models.Model):id = models.BigAutoField(primary_key=True)app = models.CharField(max_length=255)name = models.CharField(max_length=255)applied = models.DateTimeField()class Meta:managed = Falsedb_table = 'django_migrations'class DjangoSession(models.Model):session_key = models.CharField(primary_key=True, max_length=40)session_data = models.TextField()expire_date = models.DateTimeField()class Meta:managed = Falsedb_table = 'django_session'class EnglishPasslist(models.Model):id = models.BigAutoField(primary_key=True)function_name = models.CharField(db_column='FUNCTION_NAME', max_length=135, blank=True, null=True) # Field name made lowercase.department = models.CharField(db_column='DEPARTMENT', max_length=135, blank=True, null=True) # Field name made lowercase.engfunc = models.CharField(db_column='ENGFUNC', max_length=135, blank=True, null=True) # Field name made lowercase.employee_id = models.CharField(db_column='EMPLOYEE_ID', max_length=135, blank=True, null=True) # Field name made lowercase.chinese_name = models.CharField(db_column='CHINESE_NAME', max_length=135, blank=True, null=True) # Field name made lowercase.entry_date = models.DateTimeField(db_column='ENTRY_DATE', blank=True, null=True) # Field name made lowercase.group_grade = models.CharField(db_column='GROUP_GRADE', max_length=135, blank=True, null=True) # Field name made lowercase.highestscores = models.CharField(db_column='HIGHESTSCORES', max_length=135, blank=True, null=True) # Field name made lowercase.highestscores_test_date = models.CharField(db_column='HIGHESTSCORES_TEST_DATE', max_length=135, blank=True, null=True) # Field name made lowercase.passcurrent = models.CharField(db_column='PASSCURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.highestscores_2year = models.CharField(db_column='HIGHESTSCORES_2YEAR', max_length=135, blank=True, null=True) # Field name made lowercase.highestscores_2year_test_date = models.CharField(db_column='HIGHESTSCORES_2YEAR_TEST_DATE', max_length=135, blank=True, null=True) # Field name made lowercase.highestscores_2year_invalid_date = models.CharField(db_column='HIGHESTSCORES_2YEAR_INVALID_DATE', max_length=135, blank=True, null=True) # Field name made lowercase.passcurrent_2year = models.CharField(db_column='PASSCURRENT_2YEAR', max_length=135, blank=True, null=True) # Field name made lowercase.pass_high_grade_2year = models.CharField(db_column='PASS_HIGH_GRADE_2YEAR', max_length=135, blank=True, null=True) # Field name made lowercase.trans_date = models.CharField(db_column='TRANS_DATE', max_length=135, blank=True, null=True) # Field name made lowercase.remark = models.CharField(db_column='REMARK', max_length=135, blank=True, null=True) # Field name made lowercase.buffer1 = models.CharField(max_length=135, blank=True, null=True)buffer2 = models.CharField(max_length=135, blank=True, null=True)buffer3 = models.CharField(max_length=135, blank=True, null=True)buffer4 = models.CharField(max_length=135, blank=True, null=True)buffer5 = models.CharField(max_length=135, blank=True, null=True)buffer6 = models.CharField(max_length=135, blank=True, null=True)buffer7 = models.CharField(max_length=135, blank=True, null=True)buffer8 = models.CharField(max_length=135, blank=True, null=True)buffer9 = models.CharField(max_length=135, blank=True, null=True)buffer10 = models.CharField(max_length=135, blank=True, null=True)record_date = models.DateTimeField(blank=True, null=True)class Meta:managed = Falsedb_table = 'english_passlist'class ManagementPasslist(models.Model):id = models.BigAutoField(primary_key=True)location = models.CharField(db_column='LOCATION', max_length=135, blank=True, null=True) # Field name made lowercase.function_code = models.CharField(db_column='FUNCTION_CODE', max_length=135, blank=True, null=True) # Field name made lowercase.function_name = models.CharField(db_column='FUNCTION_NAME', max_length=135, blank=True, null=True) # Field name made lowercase.deptid = models.CharField(db_column='DEPTID', max_length=135, blank=True, null=True) # Field name made lowercase.grade_range = models.CharField(db_column='GRADE_RANGE', max_length=135, blank=True, null=True) # Field name made lowercase.emplid = models.CharField(db_column='EMPLID', max_length=135, blank=True, null=True) # Field name made lowercase.name = models.CharField(db_column='NAME', max_length=135, blank=True, null=True) # Field name made lowercase.current_range_course_total = models.CharField(db_column='CURRENT_RANGE_COURSE_TOTAL', max_length=135, blank=True, null=True) # Field name made lowercase.current_range_1st_assessment_total = models.CharField(db_column='CURRENT_RANGE_1ST_ASSESSMENT_TOTAL', max_length=135, blank=True, null=True) # Field name made lowercase.current_range_present_total = models.CharField(db_column='CURRENT_RANGE_PRESENT_TOTAL', max_length=135, blank=True, null=True) # Field name made lowercase.current_range_2nd_assessment_total = models.CharField(db_column='CURRENT_RANGE_2ND_ASSESSMENT_TOTAL', max_length=135, blank=True, null=True) # Field name made lowercase.p1_rate = models.CharField(db_column='P1_RATE', max_length=135, blank=True, null=True) # Field name made lowercase.p2_rate = models.CharField(db_column='P2_RATE', max_length=135, blank=True, null=True) # Field name made lowercase.p3_rate = models.CharField(db_column='P3_RATE', max_length=135, blank=True, null=True) # Field name made lowercase.current_range_rate = models.CharField(db_column='CURRENT_RANGE_RATE', max_length=135, blank=True, null=True) # Field name made lowercase.record_date = models.DateTimeField(blank=True, null=True)buffer1 = models.CharField(max_length=135, blank=True, null=True)buffer2 = models.CharField(max_length=135, blank=True, null=True)buffer3 = models.CharField(max_length=135, blank=True, null=True)buffer4 = models.CharField(max_length=135, blank=True, null=True)buffer5 = models.CharField(max_length=135, blank=True, null=True)buffer6 = models.CharField(max_length=135, blank=True, null=True)buffer7 = models.CharField(max_length=135, blank=True, null=True)buffer8 = models.CharField(max_length=135, blank=True, null=True)buffer9 = models.CharField(max_length=135, blank=True, null=True)buffer10 = models.CharField(max_length=135, blank=True, null=True)class Meta:managed = Falsedb_table = 'management_passlist'class PeopleData(models.Model):pkid = models.IntegerField(blank=True, null=True)batchid = models.TextField(blank=True, null=True)bu = models.TextField(blank=True, null=True)bg = models.TextField(blank=True, null=True)site = models.TextField(blank=True, null=True)plant = models.TextField(blank=True, null=True)emplid = models.TextField(blank=True, null=True)name = models.TextField(blank=True, null=True)name_a = models.TextField(blank=True, null=True)hire_dt = models.DateTimeField(blank=True, null=True)sal_location_a = models.TextField(blank=True, null=True)company = models.TextField(blank=True, null=True)deptid = models.TextField(blank=True, null=True)location = models.TextField(blank=True, null=True)jobtitle_descr = models.TextField(blank=True, null=True)emailid = models.TextField(blank=True, null=True)email_address_a = models.TextField(blank=True, null=True)phone_a = models.TextField(blank=True, null=True)officer_level_a = models.TextField(blank=True, null=True)supervisor_id = models.TextField(blank=True, null=True)tree_level_num = models.TextField(blank=True, null=True)termination_dt = models.DateTimeField(blank=True, null=True)labor_type = models.TextField(blank=True, null=True)job_family = models.TextField(blank=True, null=True)grade = models.TextField(blank=True, null=True)job_entry_dt = models.DateTimeField(blank=True, null=True)grade_entry_dt = models.DateTimeField(blank=True, null=True)job_title_a = models.TextField(blank=True, null=True)last_updt_dt = models.DateTimeField(blank=True, null=True)jobcode = models.TextField(blank=True, null=True)action_reason = models.TextField(blank=True, null=True)sex = models.TextField(blank=True, null=True)birthdate = models.DateTimeField(blank=True, null=True)batch_id = models.TextField(blank=True, null=True)version_id = models.IntegerField(blank=True, null=True)class Meta:managed = Falsedb_table = 'people_data'class ProfessionPasslist(models.Model):id = models.BigAutoField(primary_key=True)location = models.CharField(db_column='LOCATION', max_length=135, blank=True, null=True) # Field name made lowercase.function_code = models.CharField(db_column='FUNCTION_CODE', max_length=135, blank=True, null=True) # Field name made lowercase.function_name = models.CharField(db_column='FUNCTION_NAME', max_length=135, blank=True, null=True) # Field name made lowercase.department = models.CharField(db_column='DEPARTMENT', max_length=135, blank=True, null=True) # Field name made lowercase.employee_id = models.CharField(db_column='EMPLOYEE_ID', max_length=135, blank=True, null=True) # Field name made lowercase.chinese_name = models.CharField(db_column='CHINESE_NAME', max_length=135, blank=True, null=True) # Field name made lowercase.entry_date = models.DateTimeField(db_column='ENTRY_DATE', blank=True, null=True) # Field name made lowercase.group_grade = models.CharField(db_column='GROUP_GRADE', max_length=135, blank=True, null=True) # Field name made lowercase.effected_date = models.CharField(db_column='EFFECTED_DATE', max_length=135, blank=True, null=True) # Field name made lowercase.pass_all = models.CharField(db_column='PASS_ALL', max_length=135, blank=True, null=True) # Field name made lowercase.all_small_test_current = models.CharField(db_column='ALL_SMALL_TEST_CURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_small_test_current = models.CharField(db_column='PASS_SMALL_TEST_CURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.all_middle_test_current = models.CharField(db_column='ALL_MIDDLE_TEST_CURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_middle_test_current = models.CharField(db_column='PASS_MIDDLE_TEST_CURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.all_final_test_current = models.CharField(db_column='ALL_FINAL_TEST_CURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_final_test_current = models.CharField(db_column='PASS_FINAL_TEST_CURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.all_others_test_current = models.CharField(db_column='ALL_OTHERS_TEST_CURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_others_test_current = models.CharField(db_column='PASS_OTHERS_TEST_CURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_testrate_current = models.CharField(db_column='PASS_TESTRATE_CURRENT', max_length=135, blank=True, null=True) # Field name made lowercase.all_training_next = models.CharField(db_column='ALL_TRAINING_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_traning_next = models.CharField(db_column='PASS_TRANING_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_trainingrate_next = models.CharField(db_column='PASS_TRAININGRATE_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.all_small_test_next = models.CharField(db_column='ALL_SMALL_TEST_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_small_test_next = models.CharField(db_column='PASS_SMALL_TEST_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.all_middle_test_next = models.CharField(db_column='ALL_MIDDLE_TEST_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_middle_test_next = models.CharField(db_column='PASS_MIDDLE_TEST_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.all_final_test_next = models.CharField(db_column='ALL_FINAL_TEST_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_final_test_next = models.CharField(db_column='PASS_FINAL_TEST_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.all_others_test_next = models.CharField(db_column='ALL_OTHERS_TEST_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_others_test_next = models.CharField(db_column='PASS_OTHERS_TEST_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.pass_testrate_next = models.CharField(db_column='PASS_TESTRATE_NEXT', max_length=135, blank=True, null=True) # Field name made lowercase.trans_date = models.CharField(db_column='TRANS_DATE', max_length=135, blank=True, null=True) # Field name made lowercase.remark = models.CharField(db_column='REMARK', max_length=135, blank=True, null=True) # Field name made lowercase.pass_trans_cur = models.CharField(db_column='PASS_TRANS_CUR', max_length=135, blank=True, null=True) # Field name made lowercase.pass_trans_nex = models.CharField(db_column='PASS_TRANS_NEX', max_length=135, blank=True, null=True) # Field name made lowercase.buffer1 = models.CharField(max_length=135, blank=True, null=True)buffer10 = models.CharField(max_length=135, blank=True, null=True)buffer2 = models.CharField(max_length=135, blank=True, null=True)buffer3 = models.CharField(max_length=135, blank=True, null=True)buffer4 = models.CharField(max_length=135, blank=True, null=True)buffer5 = models.CharField(max_length=135, blank=True, null=True)buffer6 = models.CharField(max_length=135, blank=True, null=True)buffer7 = models.CharField(max_length=135, blank=True, null=True)buffer8 = models.CharField(max_length=135, blank=True, null=True)buffer9 = models.CharField(max_length=135, blank=True, null=True)record_date = models.DateTimeField(blank=True, null=True)class Meta:managed = Falsedb_table = 'profession_passlist'class TrainingImportCsodTrainingAndTestRecordForModel(models.Model):id = models.BigAutoField(primary_key=True)file = models.CharField(max_length=100)name = models.CharField(max_length=50)class Meta:managed = Falsedb_table = 'training_import_csod_training_and_test_record_for_model'class TrainingImportEnglishPasslistForModel(models.Model):id = models.BigAutoField(primary_key=True)file = models.CharField(max_length=100)name = models.CharField(max_length=50)class Meta:managed = Falsedb_table = 'training_import_english_passlist_for_model'class TrainingImportManagementPasslistForModel(models.Model):id = models.BigAutoField(primary_key=True)file = models.CharField(max_length=100)name = models.CharField(max_length=50)class Meta:managed = Falsedb_table = 'training_import_management_passlist_for_model'class TrainingImportProfessionPasslistForModel(models.Model):id = models.BigAutoField(primary_key=True)file = models.CharField(max_length=100)name = models.CharField(max_length=50)class Meta:managed = Falsedb_table = 'training_import_profession_passlist_for_model'class TrainingImportTrsTrainerMaintainForModel(models.Model):id = models.BigAutoField(primary_key=True)file = models.CharField(max_length=100)name = models.CharField(max_length=50)class Meta:managed = Falsedb_table = 'training_import_trs_trainer_maintain_for_model'class TrainingImportTrsTrainingAndTestRecordForModel(models.Model):id = models.BigAutoField(primary_key=True)file = models.CharField(max_length=100)name = models.CharField(max_length=50)class Meta:managed = Falsedb_table = 'training_import_trs_training_and_test_record_for_model'class TrainingImportZzRecordForModel(models.Model):id = models.BigAutoField(primary_key=True)file = models.CharField(max_length=100)name = models.CharField(max_length=50)class Meta:managed = Falsedb_table = 'training_import_zz_record_for_model'class TrsTrainerMaintain(models.Model):id = models.BigAutoField(primary_key=True)trainer_id = models.CharField(db_column='TRAINER_ID', max_length=135, blank=True, null=True) # Field name made lowercase.trainer_name = models.CharField(db_column='TRAINER_NAME', max_length=135, blank=True, null=True) # Field name made lowercase.deptment_id = models.CharField(db_column='DEPTMENT_ID', max_length=135, blank=True, null=True) # Field name made lowercase.plant = models.CharField(db_column='PLANT', max_length=135, blank=True, null=True) # Field name made lowercase.grade_code = models.CharField(db_column='GRADE_CODE', max_length=135, blank=True, null=True) # Field name made lowercase.score = models.CharField(db_column='SCORE', max_length=135, blank=True, null=True) # Field name made lowercase.honor = models.CharField(db_column='HONOR', max_length=135, blank=True, null=True) # Field name made lowercase.effective_date = models.CharField(db_column='EFFECTIVE_DATE', max_length=135, blank=True, null=True) # Field name made lowercase.iscurrent_grade = models.CharField(db_column='ISCURRENT_GRADE', max_length=135, blank=True, null=True) # Field name made lowercase.update_user = models.CharField(db_column='UPDATE_USER', max_length=135, blank=True, null=True) # Field name made lowercase.update_date = models.CharField(db_column='UPDATE_DATE', max_length=135, blank=True, null=True) # Field name made lowercase.employeeid = models.CharField(db_column='EMPLOYEEID', max_length=135, blank=True, null=True) # Field name made lowercase.location = models.CharField(db_column='LOCATION', max_length=135, blank=True, null=True) # Field name made lowercase.class Meta:managed = Falsedb_table = 'trs_trainer_maintain'class TrsTrainingAndTestRecord(models.Model):id = models.BigAutoField(primary_key=True)location = models.CharField(db_column='Location', max_length=135, blank=True, null=True) # Field name made lowercase.function_code = models.CharField(db_column='Function_Code', max_length=135, blank=True, null=True) # Field name made lowercase.function_name = models.CharField(db_column='Function_Name', max_length=135, blank=True, null=True) # Field name made lowercase.plant = models.CharField(db_column='Plant', max_length=135, blank=True, null=True) # Field name made lowercase.dept = models.CharField(db_column='Dept', max_length=135, blank=True, null=True) # Field name made lowercase.employee_no = models.CharField(db_column='Employee_NO', max_length=135, blank=True, null=True) # Field name made lowercase.name = models.CharField(db_column='Name', max_length=135, blank=True, null=True) # Field name made lowercase.grade_range = models.CharField(db_column='Grade_Range', max_length=135, blank=True, null=True) # Field name made lowercase.training_type = models.CharField(db_column='Training_Type', max_length=135, blank=True, null=True) # Field name made lowercase.priority = models.CharField(db_column='Priority', max_length=135, blank=True, null=True) # Field name made lowercase.type = models.CharField(db_column='Type', max_length=135, blank=True, null=True) # Field name made lowercase.course = models.CharField(db_column='Course', max_length=135, blank=True, null=True) # Field name made lowercase.schedule_code = models.CharField(db_column='Schedule_Code', max_length=135, blank=True, null=True) # Field name made lowercase.schedule_name = models.CharField(db_column='Schedule_Name', max_length=135, blank=True, null=True) # Field name made lowercase.course_or_test = models.CharField(db_column='Course_or_Test', max_length=135, blank=True, null=True) # Field name made lowercase.delivery_way_or_test_way = models.CharField(db_column='Delivery_Way_or_Test_Way', max_length=135, blank=True, null=True) # Field name made lowercase.start_date = models.DateTimeField(db_column='Start_Date', blank=True, null=True) # Field name made lowercase.end_date = models.DateTimeField(db_column='End_Date', blank=True, null=True) # Field name made lowercase.present_status = models.CharField(db_column='Present_Status', max_length=135, blank=True, null=True) # Field name made lowercase.pass_score = models.IntegerField(db_column='Pass_Score', blank=True, null=True) # Field name made lowercase.listening_score = models.IntegerField(db_column='Listening_Score', blank=True, null=True) # Field name made lowercase.reading_score = models.IntegerField(db_column='Reading_Score', blank=True, null=True) # Field name made lowercase.score = models.IntegerField(db_column='Score', blank=True, null=True) # Field name made lowercase.pass_yn = models.CharField(db_column='Pass_YN', max_length=135, blank=True, null=True) # Field name made lowercase.effective_date = models.CharField(db_column='Effective_Date', max_length=135, blank=True, null=True) # Field name made lowercase.duration = models.CharField(db_column='Duration', max_length=135, blank=True, null=True) # Field name made lowercase.venue = models.CharField(db_column='Venue', max_length=135, blank=True, null=True) # Field name made lowercase.trainer_assesor = models.CharField(db_column='Trainer_Assesor', max_length=135, blank=True, null=True) # Field name made lowercase.class Meta:managed = Falsedb_table = 'trs_training_and_test_record'class ZzRecord(models.Model):id = models.BigAutoField(primary_key=True)employee_id = models.CharField(db_column='Employee_ID', max_length=135, blank=True, null=True) # Field name made lowercase.name = models.CharField(db_column='Name', max_length=135, blank=True, null=True) # Field name made lowercase.role = models.CharField(db_column='Role', max_length=135, blank=True, null=True) # Field name made lowercase.class Meta:managed = Falsedb_table = 'zz_record'
修改部分信息
pkid = models.IntegerField(primary_key=True)
相关文章:
【Django】如何转化已有的数据表到Django模型--20230823
初步生成model.py $ python manage.py inspectdb $ python manage.py inspectdb > models.py python manage.py inspectdb # This is an auto-generated Django model module. # Youll have to do the following manually to clean this up: # * Rearrange models order…...
【C语言】喝汽水问题
大家好!今天我们来学习C语言中的喝汽水问题! 目录 1. 题目内容: 2. 思路分析 2.1 方法一 2.2 方法二 2.3 方法三 3. 代码实现 3.1 方法一 3.2 方法二 3.3 方法三 1. 题目内容 喝汽水,1瓶汽水1元,2个空瓶可以…...
项目进度管理(4-2)关键链法和关键路径法的区别和联系
1 关键链法和关键路径法的主要区别 1.1 关键链法和关键路径法的关注焦点不同 关键路径法(CPM):关注项目中最长的路径,也就是所需时间最长的路径,这被称为关键路径。关键路径决定了项目的最早完成时间。关键链法&…...
基于Java+SpringBoot+Vue前后端分离医院后台管理系统设计和实现
博主介绍:✌全网粉丝30W,csdn特邀作者、博客专家、CSDN新星计划导师、Java领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ 🍅文末获取源码联系🍅 👇🏻 精彩专…...
二维数组传参
在C语言中,可以通过指针来传递二维数组。二维数组实际上是一个连续的内存块,可以使用指针来表示二维数组的行和列。以下是一个示例: #include <stdio.h>void myFunction(int arr[][3], int rows) {for (int i 0; i < rows; i) {fo…...
AI 绘画Stable Diffusion 研究(十四)SD 图生图+剪映制作人物说话视频
大家好,我是风雨无阻。 前一篇,我们详细介绍了使用 SadTlaker制作数字人视频案例,感兴趣的朋友请前往查看:AI 绘画Stable Diffusion 研究(十三)SD数字人制作工具SadTlaker使用教程。 对于没有安装 SadTlaker 插件的朋友…...
ProPlot 基本语法及特点
文章目录 简介多子图绘制处理共享轴标签“跨度”轴标签多子图序号的绘制 更简单的颜色条和图例更加美观的颜色和字体 简介 科研论文配图多图层元素(字体、坐标轴、图例等)的绘制条件提出了更高要求,我们需要更改 Matplotlib 和 Seaborn 中的…...
element-template-admin get请求正常 post请求超市问题
最近搞全栈,想写个增删改查连接element-template-admin框架,postman测get和post请求都正常,到框架里直接超时,看网络请求一直是padding状态,后来经查阅资料,发现是这个template框架的问题 解决方案&#x…...
Promise.all和promise.race的应用场景举例
Promise.all( ).then( )适用于处理多个异步任务,且所有的异步任务都得到结果时的情况。 <template><div class"box"><el-button type"primary" plain click"clickFn">点开弹出框</el-button></div> &…...
go学习-指针 标识符
指针,以及标识符 1.指针 (1).基本介绍 1)基本数据类型,变量存的值,也叫值类型 2)获取变量的地址用&,比如 var num int ,获取num的地址:&num 3)指针类型&…...
LeetCode--HOT100题(42)
目录 题目描述:108. 将有序数组转换为二叉搜索树(简单)题目接口解题思路代码 PS: 题目描述:108. 将有序数组转换为二叉搜索树(简单) 给你一个整数数组 nums ,其中元素已经按 升序 排列…...
YOLOv8教程系列:三、K折交叉验证——让你的每一份标注数据都物尽其用(yolov8目标检测+k折交叉验证法)
YOLOv8教程系列:三、K折交叉验证——让你的每一份标注数据都物尽其用(yolov8目标检测k折交叉验证法) 0.引言 k折交叉验证(K-Fold Cross-Validation)是一种在机器学习中常用的模型评估技术,用于估计模型的性…...
leetcode算法题--表示数值的字符串
原题链接:https://leetcode.cn/problems/biao-shi-shu-zhi-de-zi-fu-chuan-lcof/description/?envTypestudy-plan-v2&envIdcoding-interviews 题目类型有点新颖,有限状态机 // CharType表示当前字符的类型 // State表示当前所处的状态 type State…...
Docker安装及Docker构建简易版Hadoop生态
一、首先在VM创建一个新的虚拟机将Docker安装好 更新系统:首先打开终端,更新系统包列表。 sudo apt-get update sudo apt-get upgrade下图是更新系统包截图 安装Docker:使用以下命令在Linux上安装Docker。 sudo apt-get install -y docker.i…...
使用Burp Suite进行Web应用渗透测试
使用Burp Suite进行Web应用渗透测试是一种常见的方法,可以帮助发现Web应用程序中的安全漏洞和弱点。 步骤: 准备工作: 首先,确保已经安装了Burp Suite,并配置浏览器以使用Burp Suite作为代理。 配置代理:…...
Github的使用指南
首次创建仓库 1.官网创建仓库 打开giuhub官网,右上角点击你的头像,随后点击your repositories 点击New开始创建仓库 如下图为创建仓库的选项解释 出现如下界面就可以进行后续的git指令操作了 2.git上传项目 进入需上传项目的所在目录,打开…...
mongodb 添加加点 stateStr 停在 STARTUP
解决办法 PRIMARY 节点是的host 是否是内网IP,如果是内网IP 需要切换成外网IP 即可;...
c语言中编译过程与预处理
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言一、c语言的编译与链接1、编译与链接概述2、编译与链接详解 二、c语言预处理1.c语言中内置的预定义符号2、#define定义标识符3、#define定义宏4、#define 替换规…...
TP-LINK 路由器设置内网穿透
TP-LINK 路由器设置内网穿透 开发中经常遇到调用第三方软件回调调试的情况,例如微信开发,支付回调等测试,用内网穿透是一种简单的方式也是偷懒的方式。 以TP-LINK路由器为例实现内网穿透 登录路由器 2.找到路由器虚拟服务器,添加…...
A 题国际旅游网络的大数据分析-详细解析与代码答案(2023 年全国高校数据统计与调查分析挑战赛
请你们进行数据统计与调查分析,使用附件中的数据,回答下列问题: ⚫ 问题 1: 请进行分类汇总统计,计算不同国家 1995 年至 2020 年累计旅游总人数,从哪个国家旅游出发的人数最多,哪个国家旅游到达的人数最多…...
《深入理解Java虚拟机》读书笔记: 类加载器
类加载器 虚拟机设计团队把类加载阶段中的“通过一个类的全限定名来获取描述此类的二进制字节流”这个动作放到Java虚拟机外部去实现,以便让应用程序自己决定如何去获取所需要的类。实现这个动作的代码模块称为“类加载器”。 类加载器可以说是Java语言的一项创新&…...
宝塔计划任务读取文件失败
想挂计划任务 相关文章【已解决】计划任务读取文件失败 - Linux面板 - 宝塔面板论坛 对方反馈的是执行下面的命令 chattr -ai /var/spool/cron 后来发现直接没有这个文件夹,然后通过mkdir命令创建文件夹,成功在宝塔创建了计划任务 后面发现任务虽然添…...
Python操作sql,备份数据库
1、批量执行sql import pymysql# 执行批量的 SQL 语句 def executeBatchSql(cursor, sqlStatements):for sql in sqlStatements:try:cursor.execute(sql)print(Executed SQL statement:, sql)except Exception as e:print(Error executing SQL statement:, e)# 创建数据库连接…...
Linux线程 --- 生产者消费者模型(C语言)
在学习完线程相关的概念之后,本节来认识一下Linux多线程相关的一个重要模型----“ 生产者消费者模型” 本文参考: Linux多线程生产者与消费者_红娃子的博客-CSDN博客 Linux多线程——生产者消费者模型_linux多线程生产者与消费者_两片空白的博客-CSDN博客…...
Vue2向Vue3过度核心技术computed计算属性
目录 1 computed计算属性1.1 概念1.2 语法1.3 注意1.4.案例1.5.代码准备 2 computed计算属性 VS methods方法2.1 computed计算属性2.2 methods计算属性2.3 计算属性的优势2.4 总结 3 计算属性的完整写法 1 computed计算属性 1.1 概念 基于现有的数据,计算出来的新属…...
芯片行业震荡期,数字后端还可以入吗?
自去年开始,芯片行业仿佛进入了动荡期,经历了去年秋招和今年春招的小伙伴都知道,如今找工作有多难。 半导体行业人才缩减、各大厂裁员,在加上高校毕业生人数破千万,对于即将踏入IC这个行业的应届生来说,今…...
“精准时空”赋能制造业智能化发展
作者:邓中亮 高达动态厘米级的高精度定位服务,不仅是北斗卫星导航系统的一大独门绝技,其在产业化应用层面也已逐步向普适化、标配化演进,并延展出时空智能新兴产业。 5月17日,当长征三号乙运载火箭成功发射北斗系统的…...
Kotlin协程flow发送时间间隔debounce
Kotlin协程flow发送时间间隔debounce debounce的作用是让连续发射的数据之间间隔起来。典型的应用场景是搜索引擎里面的关键词输入,当用户输入字符时候,有时候,并不希望用户每输入任何一个单字就触发一次后台真正的查询,而是希望…...
ServiceManager接收APP的跨进程Binder通信流程分析
现在一起来分析Server端接收(来自APP端)Binder数据的整个过程,还是以ServiceManager这个Server为例进行分析,这是一个至下而上的分析过程。 在分析之前先思考ServiceManager是什么?它其实是一个独立的进程,由init解析i…...
wordpress宠物模板/百度引流推广哪家好
如果不换罗米,如果门将没受伤,如果梅西能够上场,如果索林守住位置,如果....没有那么多如果....足球就是足球,Argentina,dont cry for me....走好...我的世界杯结束了 转载于:https://www.cnblogs.com/maxwolf/archive/2006/07/02/440646.html...
如何查看用wordpress建的站点/阿拉营销网站
文章目录一、题目1、题目描述2、基础框架3、原题链接二、解题报告1、思路分析2、时间复杂度3、代码详解三、本题小知识四、加群须知一、题目 1、题目描述 设计一种算法,将一个新节点插入到一个完全二叉树中,并在插入后保持其完整。实现 CBTInserter类: …...
wordpress媒体库不能用云/站长工具最近查询
之前我们讨论过《Linux Oracle 11g dataguard物理standby 配置过程》, 但是在实际过程中会遇到不同的问题,首先我们讨论下ORACLE DATA…...
无锡企业制作网站/做网页的网站
分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!数据采集的工作模式可以分为被动模式(服务器…...
怎样做网站标题的图标/品牌推广的目的和意义
项目功能演示视频地址: https://www.bilibili.com/video/BV1754y1q7cv (本项目的功能都在这里有介绍呀,小编自制,比较简陋,喜欢的博友可以点击看看,点个赞呀!) 后端功能设计 数据库…...
网站建设的机构/百度识图扫一扫
问题描述:在引用百分比布局AutoLayout无显示报Failed to load Appcompat Actionbar with unknown error 如下图 加载带有未知错误的AppCompat ActionBar失败。一路小找,发现这布局与原标题冲突(同事引用时没这冲突,不知道其他人有…...