class Person(models.Model):
#db_column='age' 重新定义字段名为age
p_name = models.CharField(max_length=16,unique=True)
p_age = models.IntegerField(default=18,db_column='age')
class Meta:
db_table="people" #重新定义表名为people
class Person(models.Model):
#db_column='age' 重新定义字段名为age
p_name = models.CharField(max_length=16,unique=True)
p_age = models.IntegerField(default=18,db_column='age')
class Meta:
db_table="people" #重新定义表名为people