读django

1.view两个做用: 返回httpresponse对象或发起一个exception,通常view会加载一个模板并用渲染模板
code

2.Django的settings中指定directories,按顺序check  directory
对象

3.three

# Create three choices.>>> p.choice_set.create(choice='Not much', votes=0)<Choice: Not much
>>> p.choice_set.create(choice='The sky', votes=0)<Choice: The sky
>>>> c = p.choice_set.create(choice='Just hacking again', votes=0)
# Choice objects have API access to their related Poll objects.
>>> c.poll<Poll: What's up?># And vice versa: Poll objects get access to Choice objects.
>>> p.choice_set.all()[<Choice: Not much>, <Choice: The sky>, <Choice: Just hacking again>]
>>> p.choice_set.count()
相关文章
相关标签/搜索