-1
mysql> describe posts;
+----------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+---------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| title | varchar(300) | NO | | NULL | |
| content | varchar(1000) | NO | | NULL | |
| created | date | YES | | NULL | |
| modified | date | YES | | NULL | |
+----------+---------------+------+-----+---------+-------+
5 rows in set (0.01 sec)
我將如何在模板中創建表單?我將如何訪問views.py中該表單的值並保存到數據庫表中?我也讀過這個=>https://docs.djangoproject.com/en/dev/topics/forms/,但無法理解如何實現它。如何將表單的值保存到mysql數據庫表中? (post method)
1.這與MySQL有什麼關係?爲什麼SQL表結構是相關的? 2.這在文檔中有完整的介紹。 – 2012-01-06 11:26:17
哪些文檔? django書或django官方文檔? – shibly 2012-01-06 12:03:36
它在[官方](https://docs.djangoproject.com/en/dev/topics/forms/)[文檔](https://docs.djangoproject.com/en/dev/topics/forms/modelforms /)和jcollado鏈接到下面的django書。 – Alasdair 2012-01-06 12:09:51