File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 88
99class Restaurant (models .Model ):
1010 name = models .CharField (max_length = 32 )
11+ location = models .CharField (max_length = 32 , default = "" )
1112
1213 class Meta :
1314 db_table = "restaurant"
@@ -58,7 +59,7 @@ class Meta:
5859 # attrs['delete'] = delete
5960 attrs ["id" ] = models .IntegerField (primary_key = True , auto_created = True )
6061 attrs ["name" ] = models .CharField (max_length = 30 )
61- attrs ["addr " ] = models .TextField (default = "Hello" , null = True , blank = True )
62+ attrs ["address " ] = models .TextField (default = "Hello" , null = True , blank = True )
6263 # attrs["location"] = models.CharField(max_length=30)
6364 # attrs["email"] = models.CharField(max_length=30)
6465 # attrs.update({field.name: field for field in restaurant_obj.__class__._meta.fields})
@@ -109,6 +110,8 @@ def add_necessary_db_columns(model_class):
109110
110111 print ("alter_field start-----" )
111112 schema_editor .alter_field (model_class , field , field )
113+ print (field )
114+ print (field .__class__ )
112115
113116 print ("column sql start-----" )
114117 sql_for_column = schema_editor .column_sql (model_class , field )
You can’t perform that action at this time.
0 commit comments