I’m using django to create a application download site. I try to write a model, that the admin can add the different download content dynamically in the admin page. For example I have a software named foobar, it have 3 different version: 1.1, 1.2, 1.3. I would like the user can admin the model by using an add button to add the download link with a download version. But I don’t know how to do this in django.
Share
Set up your models to have a main model and ancillary models that have foreign keys to the main model:
then, when you have an instance of your DownloadItem model, you can get hold of your various file versions with:
To be able to add files via the Admin, you will need to use an inline. In your admin.py for the app in question, you’ll need to add something like: