我正在尝试解压缩使用python的 function ticked() {
link
.attr("x1", function(d) {
return d.source.x*3.4;
})
.attr("y1", function(d) {
return d.source.y*3.4;
})
.attr("x2", function(d) {
return d.target.x*3.4;
})
.attr("y2", function(d) {
return d.target.y*3.4;
});
node
.attr("rx", function(d) {
if (d.type === "Customer") { return 100
} else { return 0 }
})
.attr("ry", function(d) {
if (d.type === "Customer") { return 100
} else { return 0 }
})
.attr("x", function(d) {
return d.x * 3.4
})
.attr("y", function(d) {
return d.y * 3.4
})
.attr("height", function(d) {
return 20
})
.attr("width", function(d) {
return 20
})
类上传的zip文件,然后将其保存到django的zipfile.ZipFile()
中,该文件已连接到远程对象存储。
但是尝试了许多组合,从将FileField
打开对象转换为zipfile
,StringIO
,BytesIO
和File等以来,我无法解决此错误。
ContentFile
class FileMeta(AuditModel, StateModel):
"""
This Model stores the Meta details
related to any document in our system.
There are model types which reflect on validations too
"""
IMAGE = 'Image'
DOCUMENT = 'Document'
IMAGE_AND_DOCUMENT = 'Image and Document'
FILE_TYPES = (
(IMAGE, IMAGE),
(DOCUMENT, DOCUMENT),
(IMAGE_AND_DOCUMENT, IMAGE_AND_DOCUMENT),
)
class Meta:
verbose_name = 'File meta'
verbose_name_plural = "File meta's"
name = models.CharField("File Type Name", max_length=100,
unique=True, db_index=True)
type = models.CharField("File type Accepted", max_length=20,
choices=FILE_TYPES, db_index=True, default=DOCUMENT)
def __str__(self):
return self.name
class File(AuditModel, StateModel):
"""
This Model stores the File
related to our system.
This model relates to the File Meta to extract
te file type for proper validation
"""
class Meta:
verbose_name = 'Document'
verbose_name_plural = 'Documents'
file_meta = models.ForeignKey(FileMeta, verbose_name="File
Definition", on_delete=models.PROTECT)
file_id = models.CharField(
"The Main ID number of the document provided",
max_length=20,
blank=True,
null=True,
)
file = models.FileField(
upload_to='documents/',
validators=[
file_size_validator,
],
)