Re: How do you write a django model that can crunch numbers and automatically populate another field with results?

2012-05-14 Thread Chris Lawlor
Also, you can use aggregate queries to get the tfidf max and min: from django.db.models import Max, Min Party.objects.all().aggregate(Max(tfidf')) {'tfidf__max': 0.5 } See https://docs.djangoproject.com/en/dev/topics/db/aggregation/#cheat-sheet On Wednesday, 9 May 2012 01:00:18 UTC-4, Andy

Re: How do you write a django model that can crunch numbers and automatically populate another field with results?

2012-05-08 Thread Andy McKay
You can hook into the model signal so that when the model changes, you do you calculation and change your models. https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save -- You received this message because you are subscribed to the Google Groups "Django users"

How do you write a django model that can crunch numbers and automatically populate another field with results?

2012-05-08 Thread Mika
There's a more detailed version of this question where I've embedded graphics and explained my algorithm to make it more clear on stackoverflow. I haven't gotten a response on it yet so I thought I might come here and see if anyone can help me out.