Can I customize the preview template in django import-export?

My admin side will be used by non-sys-admin users, so I would like this to be as clear as possible. I do not understand how to set up a preview before confirming the import.

To add objects with a foreign key reference, I'm just looking for an identifier that matches the function before_importand will replace it, as it explains here .

If you change the data set in the before_import function, it does not apply to the preview, the preview only displays the object of my model class, nothing more ...

How can I display the family name (column Famille) in my example? enter image description here

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')
+2

All Articles