摘要: ManyToMany参数((through,db_constraint)) class Book(models.Model): name=models.CharField(max_length=20) authors=models.ManyToMany('Author',through='Score 阅读全文
posted @ 2022-12-16 16:01 张张包~ 阅读(1118) 评论(0) 推荐(0) 编辑
摘要: 装饰器 装饰器:写代码要遵循开放封闭原则,装饰器本质是一个嵌套函数(被套着的函数就是闭包),它可以让被装饰函数在不需要做任何代码变动的前提下增加额外功能,装饰器的返回值也是一个函数对象。 加载顺序自下而上,执行顺序自上而下 @classmethod,@staticmethod,@property,@ 阅读全文
posted @ 2022-12-16 15:42 张张包~ 阅读(38) 评论(0) 推荐(0) 编辑