I'm getting some strange errors when trying to use the aggregate
functions. My model looks like...
class test(models.Model):
a = models.IntegerField()
After creating a few records, I try the following:
>>> test.objects.all().aggregate(sum('a'))
Traceback (most recent call last):
File "<console>", line 1, in ?
TypeError: unsupported operand type(s) for +: 'int' and 'str'
>>> test.objects.all().aggregate(max('a'))
Traceback (most recent call last):
File "<console>", line 1, in ?
File "/usr/lib/python2.4/site-packages/django/db/models/query.py",
line 303, in aggregate
kwargs[arg.default_alias] = arg
AttributeError: 'str' object has no attribute 'default_alias'
I get the same response from django 1.2.0 and current SVN, .python
2.4.3 under CentOS 5.4.
Am I missing something here? Do I have the syntax correct? Any help
would be appreciated.
Wally.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.