the model layer
Model:A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the data you’re storing. Generally, each model maps to a single database table.
model 的创建。
① ob = Object(); ob.attr='*'; ob.save();
② ob = Object(attr='*'); ob.save();
③ ob = Object.objects.create(attr='*'); ob.save();
model的对象中的多对多,多对一,一对一关系。
多对多:models.ManyToManyField(Model_name)
多对一:models.ForeignKey(Model_name)