Skip to content

Commit 3022b89

Browse files
committed
addr change
1 parent a3b871e commit 3022b89

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

my_app/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
class 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)

0 commit comments

Comments
 (0)