[問題] Djangobook上的一段話 看不懂哩
各位大大
在djangobook上有一段說明為啥要data model的地方看不太懂
有人可以幫忙解說一下嗎?
這裏的introspection是指?
感謝
http://djangobook.com/django-models/
Introspection requires overhead and is imperfect.
In order to provide convenient data-access APIs, Django needs to know
the database layout somehow, and there are two ways of accomplishing this.
The first way would be to explicitly describe the data in Python,
and the second way would be to introspect the database at runtime to
determine the data models.This second way seems cleaner, because
the metadata about your tables lives in only one place, but it introduces
a few problems. First, introspecting a database at runtime obviously
requires overhead. If the framework had to introspect the database
each time it processed a request, or even only when the Web server
was initialized, this would incur an unacceptable level of overhead.
(While some believe that level of overhead is acceptable,
Django’s developers aim to trim as much framework overhead as possible.)
Second, some databases, notably older versions of MySQL,
do not store sufficient metadata for accurate and complete introspection.
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.226.168.84
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1476496575.A.7BB.html
※ 編輯: left (36.226.168.84), 10/15/2016 09:57:46
推
10/16 12:55, , 1F
10/16 12:55, 1F
→
10/16 12:55, , 2F
10/16 12:55, 2F
推
10/16 13:04, , 3F
10/16 13:04, 3F
→
10/16 13:04, , 4F
10/16 13:04, 4F
→
10/16 13:04, , 5F
10/16 13:04, 5F
→
10/16 13:04, , 6F
10/16 13:04, 6F
→
10/16 13:04, , 7F
10/16 13:04, 7F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
Python 近期熱門文章
PTT數位生活區 即時熱門文章