当前位置: 首页 > news >正文

《Django 5 By Example》阅读笔记:p543-p550

《Django 5 By Example》学习第 19 天,p543-p550 总结,总计 8 页。

一、技术总结

1.fixtures

(1)定义

A fixture is a collection of files that contain the serialized contents of the database.

在这里插入图片描述

(2)作用

1)数据导入

一般来说,我们是通过数据库工具(如:Navicat,DBeaver)进行数据导入和导出。在 Django中,也可以通过 fixtures 结合 duamdata 、loaddata 命令进行数据导入导出。

单纯从数据导入导出这点来说,我更倾向于使用数据库工具进行操作,因为这更通用。

(3)示例

注:educa是 project, courses 是 application。

educa# mkdir courses/fixtureeduca# python manage.py dumpdata courses --indent=2 --output=courses/fixtures/subjects.jsoneduca# python manage.py loaddata subjects.json

2.model inheritance

Django中有三种类型 model inheritance:

(1)abstract model

(2)multi-table model inheritance

(3)proxy model

二、英语总结(生词:2)

1.polymorphism

(1)polymorph

poly-(“many”) + morph(“form, shape”)

(2)polymorphism: polymorph + -ism

u. the fact the sth can exist in different forms(多态性)。

(3)polymorphous vs polymorphic

adj. having many different forms(多态的)。polymorphous 和 polymorphic的意思是一样的,他们之间的区别是:

1)polymorphous

Commonly used as a descriptive term in general contexts, including art, literature, and natural sciences.

示例:Water is a polymorphous substance, taking the form of ice, liquid, or vapor.

2)polymorphic

Often used in technical or scientific contexts, such as programming, biology, or chemistry.

示例:The class exhibits polymorphic behavior by overriding methods in different subclasses.

2.provision

(1)provision: pro-(“before, forward”) + vision(from videre, “to see”)

字面意思是“to see beforehand(预先看看)”, “to prepare in advance(提前准备)”,后面演变为:c/u. the act of providing sth。

(2)provide: provision 是 provide 的名词形式。

p546, Polymorphism is the provision of a single interface to entities of different types(多态是为不同类型的实体提供单一接口).

三、其它

今天没有什么想说的。

四、参考资料

1. 编程

(1) Antonio Melé,《Django 5 By Example》:https://book.douban.com/subject/37007362/

2. 英语

(1) Etymology Dictionary:https://www.etymonline.com

(2) Cambridge Dictionary:https://dictionary.cambridge.org

在这里插入图片描述

欢迎搜索及关注:编程人(a_codists)

http://www.lryc.cn/news/503692.html

相关文章:

  • 精品基于Python实现的微信小程序校园导航系统-微信小程序
  • 【数字花园】个人知识库网站搭建:①netlify免费搭建数字花园
  • 数据仓库工具箱—读书笔记01(数据仓库、商业智能及维度建模初步)
  • 分布式 窗口算法 总结
  • docker容器内部启动jupyter notebook但是宿主机无法访问的解决方法
  • 2.2 数据库设计方法
  • ALOHA 协议详解
  • Quant connect的优势和不足,学习曲线难
  • 分布式 漏桶算法 总结
  • 2450.学习周刊-2024年50周
  • 前端性能优化实战:从加载到渲染的全链路提升
  • pdf merge
  • Python高性能web框架-FastApi教程:(3)路径操作装饰器方法的参数
  • 怎么禁用 vscode 中点击 go 包名时自动打开浏览器跳转到 pkg.go.dev
  • bean创建源码
  • axfbinhexelf文件区别
  • ABAP时间戳与日期时间转换及时区处理
  • #渗透测试#漏洞挖掘#红蓝攻防#护网#sql注入介绍01
  • Flink是什么?Flink技术介绍
  • DETR-ResNet-50:Facebook的革命性目标检测模型
  • 0002.基于springboot +layui二手物品交易平台
  • 【游戏设计原理】7 - 加德纳的多元智能理论
  • React Image Crop——在React应用中轻松实现图片裁剪功能
  • 深度对比:Ubuntu 与 CentOS 系统的异同点解析
  • 操作系统内存管理
  • 数据链路层(Java)(MAC与IP的区别)
  • 图像像素如何排列?是如何存储到diocm里面?读取到内存中是如何存储?
  • HDR视频技术之七:逆色调映射
  • 12.10深度学习_经典神经网络_GoogleNet自我理解
  • 漫谈 Vercel Serverless 函数