赞
踩
I'm using django 1.8.9 and MySQL 5.7.17. I've a following table:
+----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+----------------+
| brand | varchar(255) | YES | MUL | NULL | |
| new_info | json | YES | | NULL | |
| keywords | json | YES | | NULL | |
| notes | varchar(255) | YES | | NULL | |
| id | mediumint(9) | NO | MUL | NULL | auto_increment |
+----------+--------------+------+-----+---------+----------------+
In django I have this model (JSONField is from django_mysql):
class info_by_kw(Model):
brand = ForeignKey(Brand, on_delete=CASCADE, db_column='brand')
# n
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。