In order to override a class method, the overriding method should also be decorated as a class method and take a required parameter cls, from which you can get class attributes. This is important to keep in mind when overriding things like PynamoDB models.
Example#
class OverridingClass(Model):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@classmethod
def classmethod(cls, *args, **kwargs):
class_attribute_example = cls.class_attribute
return super().classmethod(*args, **kwargs)