Django与模型视图控制器 [英] Django vs. Model View Controller
问题描述
功能上,我们可以从这些差异中获得什么,例如,Ruby on Rails?
当你编码时,不考虑框架片的名称,没有可疑的差异,例如RoR。但是,这取决于你使用模型
,因为在Django上,他们很容易包含一些逻辑,其他框架将保持在控制器级别。
Django上的视图
往往是一组用于获取数据的查询,并将其传递给模板。
Can somebody explain me where the diferences are between Django and the Model View Controller pattern?
Functionally, what can we expect from those differences — i.e. what works differently comparing Django to, for example, Ruby on Rails?
When you code, not thinking about names of framework pieces, there are no susbtantive differences betw, for example RoR. But it depends on the use you give models
, since on Django they easily contain some logic that on other frameworks would stay at controller level.
The view
on Django tends to be a set of queries for fetching data, and pass them to the template.
这篇关于Django与模型视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!