I'm a little lost and don't know how to continue, after a lot of search I think that I'm not doing correctly it.
My problem is that I've got a offer class model like this one:
class Offer(models.Model):
design_hours = models.IntegerField()
design_price = models.DecimalField(max_digits=10, decimal_places=2)
devel_hours = models.IntegerField()
devel_price = models.DecimalField(max_digits=10, decimal_places=2)
offer_price = models.DecimalField(max_digits=10, decimal_places=2)
Where offer_price is a calculated field (desig_hours * design_price + devel_hours * devel_price), I don't have problems overriding the save method.
class OfferAdmin(VersionAdmin):
list_display = (
'design_hours',
'design_price',
'devel_hours',
'devel_price',
'offer_price')
What I'd like to do is in the add/change form show a not editable field wich auto calculate when changing the design_hours or the design_prices form fields.
I supose that I have to override the change_form.html template but from here I don't know what to do :(
Thanks,