Django - FilerFileField直接上传

时间:2014-09-25 11:11:35

标签: python django

在我的django项目中,有一个书模型,你可以附加一个pdf。

class Product(CategoryProductBase):
    book = FilerFileField( verbose_name=_("Book"),)
    description = HTMLField(null=True,blank=True)

我的表格:

class UploadBookForm(forms.ModelForm):
    book = forms.ModelChoiceField(queryset=filer.models.File.objects.all(),label=u"Buch als PDF")
    description = forms.CharField(label=u"Kurzbeschreibung")

我在那里使用了ModelChoiceField,但是如何使用FileField呢?我希望PDF从django filer egg上传到文件管理器。我希望它保存在名为“Book”的文件夹中。

0 个答案:

没有答案