I'm trying to change the attribute date
of my Product Attributes because it is a DateField and I need a DateTimeField (I want to implement a countdown on my website). I found out that the app responsible for it is oscar.apps.catalogue
and the attribute that I want to modify (date) is located inside abstract_models.py
in the catalogue app folder (AbstractProductAttributeValue
class).
I forked the project and created a ProductAttributeValue
class inheriting from AbstractProductAttributeValue
but Python doesn't allow to modify a parent class attribute so I can't just modify that attribute.
Is there a way to modify that attribute or will I have to modify the original Django-Oscar file (abstract_models.py
)?
EDIT: I'm trying to modify the Django-oscar behaviour by inheriting a class. Using AbstractProductAttributeValue._meta.get_field('value_date').default = models.DateTimeField(_('Date and Time'), blank=True, null=True)
to change the parent class attribute doesn't work and shows me an error when I try to use python manage.py migrate
: "AttributeError: 'DateField' object has no attribute 'model'"