Как запустить @classmethod как задачу Celery в Django?Вот пример кода:
class Notification(TimeStampedModel):
....
@classmethod
def send_sms(cls, message, phone, user_obj=None, test=False):
send_message(frm=settings.NEXMO_FROM_NUMBER, to=phone, text=message)
return cls.objects.create(
user=user_obj,
email="",
phone=phone,
text_plain=message,
notification_type=constants.NOTIFICATION_TYPE_SMS,
sent=True,
)
n = Notification()
n.send_sms(message='test', phone='1512351235')