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