-
Notifications
You must be signed in to change notification settings - Fork 5
Upgrade #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Upgrade #45
Changes from all commits
fce302e
b75decb
c379ba4
210335d
529032c
99fe6b8
41afcca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,4 +40,4 @@ networks: | |
| front-tier: | ||
| driver: bridge | ||
| back-tier: | ||
| driver: bridge | ||
| driver: bridge | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,10 @@ | |
| import os | ||
| PROJECT_ROOT = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) | ||
|
|
||
| DEBUG = config('DEBUG', default=False, cast=bool) | ||
| DEBUG = True | ||
| TEMPLATE_DEBUG = DEBUG | ||
|
|
||
|
|
||
| ADMINS = ( | ||
| # ('Your Name', 'your_email@domain.com'), | ||
| ) | ||
|
|
@@ -122,6 +123,7 @@ | |
| 'django.contrib.sessions.middleware.SessionMiddleware', | ||
| 'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
| 'django.contrib.messages.middleware.MessageMiddleware', | ||
| 'django_pdb.middleware.PdbMiddleware', | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ease of debugging |
||
| ) | ||
|
|
||
| ROOT_URLCONF = config('ROOT_URLCONF', default='pgd.urls') | ||
|
|
@@ -130,11 +132,12 @@ | |
| WSGI_APPLICATION = 'pgd.wsgi.application' | ||
|
|
||
| TEMPLATE_DIRS = ( | ||
| '%s/templates' % DOC_ROOT | ||
| '%s/templates' % DOC_ROOT, | ||
| ) | ||
|
|
||
| INSTALLED_APPS = ( | ||
| 'django.contrib.auth', | ||
| 'django_pdb', | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ease of debugging |
||
| 'django.contrib.contenttypes', | ||
| 'django.contrib.sessions', | ||
| 'django.contrib.sites', | ||
|
|
@@ -175,6 +178,7 @@ | |
| } | ||
| } | ||
|
|
||
| DJANGO_SETTINGS_MODULE = 'pgd.settings' | ||
| # PGD Specific settings | ||
| QUERY_LIMIT = config('QUERY_LIMIT', default=50000000, cast=int) | ||
| SEGMENT_SIZE = config('SEGMENT_SIZE', default=10, cast=int) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ class PGDAggregate(Aggregate): | |
| Modified to allow Aggregate functions outside of the Django module | ||
| """ | ||
|
|
||
|
|
||
| def add_to_query(self, query, alias, col, source, is_summary): | ||
| """Add the aggregate to the nominated query. | ||
|
|
||
|
|
@@ -24,13 +25,15 @@ def add_to_query(self, query, alias, col, source, is_summary): | |
| * is_summary is a boolean that is set True if the aggregate is a | ||
| summary value rather than an annotation. | ||
| """ | ||
| self.queryObj = query | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will be removed, had it for debugging purpose |
||
| klass = globals()['%sSQL' % self.name] | ||
| aggregate = klass(col, source=source, is_summary=is_summary, **self.extra) | ||
|
|
||
| # Validate that the backend has a fully supported, correct | ||
| # implementation of this aggregate | ||
| self.aggr = aggregate | ||
| query.aggregates[alias] = aggregate | ||
| self.aggregate = aggregate | ||
|
|
||
|
|
||
|
|
||
| class DirectionalStdDev(PGDAggregate): | ||
|
|
@@ -63,3 +66,4 @@ class BinSort(PGDAggregate): | |
| class BinSortSQL(SQLAggregate): | ||
| sql_function = '' | ||
| sql_template = '%(function)sFLOOR((IF(%(field)s<%(offset).16f,360,0)+%(field)s-%(offset).16f)/%(bincount).16f)-IF(%(field)s=%(max).16f,1,0)' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ease of debugging