Is-it possible to customize the template of preview in django import-export?

偶尔善良 提交于 2020-01-02 08:46:52

问题


My admin side will be used by no-sys-admin persons so I would like it to be as clear as possible. I don't understand how can I customize the preview before confirming import.

To add objects with foreign key reference I juste look for id that matches in before_import function and replace it as it's explain here.

If you modify the dataset in before_import function, it doesn't spread to the preview, preview only display the object of my model class, nothing more...

How can I display the name of the family (column Famille) in my exemple ?

My model :

class TGenres(models.Model):
    id_genre = models.AutoField(primary_key=True, unique=True)
    nom_genre = models.CharField(max_length=1024,verbose_name='nom de genre')
    id_fam = models.ForeignKey(TFamilles, null=True, db_column='id_fam', blank=True, verbose_name='Famille')

来源:https://stackoverflow.com/questions/29071490/is-it-possible-to-customize-the-template-of-preview-in-django-import-export

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!