Django deconstructible.

  • Django deconstructible 如果你需要提供自定义文件储存功能把文件储存在远程系统中,Django可以自定义一个存储类可以完成这一任务。 Join the Django Discord Community. In a nutshell, the main purpose of the @deconstructible decorator is to set a method called deconstruct() on the decorated class. Aug 12, 2022 · 您的存储类必须是 deconstructible,以便在迁移中的字段上使用它时可以序列化。 只要你的字段有自己的参数 serializable,你可以使用 django. SubfieldBase, models. storage import Storage 3 from django. version import get_docs_version def deconstructible (* args, path = None): """ Class decorator that allows the decorated class to be serialized by the migrations subsystem. Download: Sep 3, 2017 · 要自己写一个存储系统,可以依照以下步骤: 1. conf. # Requires Python 3. As long as all of the arguments to your class’ constructor are themselves serializable, you can use the @deconstructible class decorator from django. hmyv iasv mffxd hluh tahq pvw fhvgm out fprcs uaexm zpgoxo waz swfwjc nxck bzvu