1

I have two models, Course and Student. I want to include a file upload field to the Course form in the admin, to accept a CSV file that I will process and store as one or more records in the Students table. My questions are:

  1. How can I add this "transient" field to the Course model, without it being a column or something in the corresponding table?
  2. Where should I do the file processing? I was thinking perhaps overriding the save_model method in the CourseAdmin class will do it, am I right?

1 Answer 1

3

1 - You can override a form class in admin. Create you own ModelForm and add necessary field there 2 - After that, override form_save or form's save() method and process your file there

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.