I'm getting the following error:
TypeError: 'int' object is not callable
response = receiver(signal=self, sender=sender, **named) File "/Users/user/Documents/workspace/LiveWireSMS/sms/models/message.py", line 156, in my_handler instance.charge = instance.length(instance.content)
From this snippet of code:
@receiver(pre_save, sender=Message)
def my_handler(sender, **kwargs):
instance = kwargs['instance']
if not instance.charge:
instance.charge = instance.length(instance.content)
This is the function its calling:
@property
def length(self):
return len(self.content) / 160 + 1
Could someone explain the error? Thank you.