This requirement is relatively easy to meet, just add a custom field to your Admin class. The Admin class for your recharge record is as follows, assuming that the consumable amount field for price adjustment is consumable_account:
Managers only need to enter the "recharge amount" to automatically calculate the "consumable amount"
Can I understand that the recharge amount on the page is a fillable field, and when the administrator enters the corresponding value, the subsequent consumable amount is immediately generated? If this is the case, it can be solved using js in the page.
As for the logical processing of data, do you want to do it before the page is generated or after the page is generated? Is the so-called data here retrieved from the database in the background or entered on the page? The description of the problem is a bit vague.
@agnewee Thank you very much for your answer Maybe the description of my problem is not very clear, so I would like to make a supplement. The framework I use is Django, and the question refers to Django’s xadmin (which can also be understood as admin, but xadmin is (rewritten it)) Whether it can perform logical processing on the page? Because Django's admin is the background management page that comes with the framework, I am a little confused because I don't know how to write logical processing for its View and process the logic. The results are returned to the Html page
This requirement is relatively easy to meet, just add a custom field to your Admin class.
The Admin class for your recharge record is as follows, assuming that the consumable amount field for price adjustment is consumable_account:
This added consumable_amount can be used like other fields, such as layout, etc.
According to what you said
Can I understand that the recharge amount on the page is a fillable field, and when the administrator enters the corresponding value, the subsequent consumable amount is immediately generated? If this is the case, it can be solved using js in the page.
As for the logical processing of data, do you want to do it before the page is generated or after the page is generated? Is the so-called data here retrieved from the database in the background or entered on the page?
The description of the problem is a bit vague.
@agnewee Thank you very much for your answer
Maybe the description of my problem is not very clear, so I would like to make a supplement. The framework I use is Django, and the question refers to Django’s xadmin (which can also be understood as admin, but xadmin is (rewritten it)) Whether it can perform logical processing on the page? Because Django's admin is the background management page that comes with the framework, I am a little confused because I don't know how to write logical processing for its View and process the logic. The results are returned to the Html page