Skip to content
Advertisement

Django: overwriting the method model of the abstract model, from inside the inherited models

I have a problem with re-assigning some var in my model, I have a model like this:

JavaScript

but in the different models that used this abstract model, I need the use different expiration times in the exprie_time:

JavaScript

so I am trying to overwrite this method in the model that was inherited from ExpireTime but it has no effect.

so how can I solve this situation? Should I not use the abstract model in this situation?

Update:

the model that was inherited from ExpireTime :

JavaScript
JavaScript

Advertisement

Answer

you can always do it on save:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement