Reputation: 15571
I need to create a simple CRUD interface for my Django app. The Django admin does 90% of what I need, but I have a couple of things that don't fit well.
Say I have a File model and a Validator model. Besides CRUDing them, I also need to be able to send a File to a Validator for validation. This is not a database action. Sending a file to a validator involves scheduling the file on the validators queue. Later (minutes or hours), when the validator completes, that fact will be noted in the database.
From a UX view, this naturally belongs on the File admin page as a dropdown to select a validator and a button. Is there a way to naturally add this to the admin?
(I am a django newbie, I apologize if this is a stupid question.)
Upvotes: 1
Views: 709
Reputation: 8354
This is a very general question. The admin allows you to extend it in almost any way you wish. I would personally start by looking at how to create packages (apps) in Django.
You can extend the admin in many ways, admin actions, other apps, custom dashboard to overwriting templates etc just to name a few.
There are also a lot of packages that already achieve this too.
For task processing of the file look at Celery. Celery is an asynchronous task queue/job queue system.
More reading: Customizing Django Admin Interface functionality
Upvotes: 1