mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #24301 -- Added PostgreSQL-specific aggregate functions
This commit is contained in:
parent
931a340f1f
commit
e4cf8c8420
10 changed files with 646 additions and 1 deletions
|
@ -62,3 +62,21 @@ else:
|
|||
class ArrayFieldSubclass(ArrayField):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ArrayFieldSubclass, self).__init__(models.IntegerField())
|
||||
|
||||
|
||||
class AggregateTestModel(models.Model):
|
||||
"""
|
||||
To test postgres-specific general aggregation functions
|
||||
"""
|
||||
char_field = models.CharField(max_length=30, blank=True)
|
||||
integer_field = models.IntegerField(null=True)
|
||||
boolean_field = models.NullBooleanField()
|
||||
|
||||
|
||||
class StatTestModel(models.Model):
|
||||
"""
|
||||
To test postgres-specific aggregation functions for statistics
|
||||
"""
|
||||
int1 = models.IntegerField()
|
||||
int2 = models.IntegerField()
|
||||
related_field = models.ForeignKey(AggregateTestModel, null=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue