I wanted to use the custom method value and compute it. Is it possible to annotate model's custom methods? If yes, can you give an example. Thanks in advance!
Model
class Project(model.models):
project_name = models.CharField(
_('Project name'),
max_length=255,
blank=True,
null=True,
)
def custom_method(self):
return 100
Query
qs = Project.objects.annotate(new_val=F('custom_method') * 1.5 )