Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
erickpeirson committed Apr 27, 2016
1 parent 2d62c10 commit c5fe012
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
13 changes: 10 additions & 3 deletions annotations/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,16 @@ def _get_recent_annotations():
"""
Generate aggregate activity feed for all annotations.
"""
recent_appellations = Appellation.objects.annotate(hour=DateTime("created", "hour", pytz.timezone("UTC"))).values("hour", "createdBy__username", "createdBy__id").annotate(appelation_count=Count('id')).order_by("-hour", "createdBy")
recent_relations = Relation.objects.annotate(hour=DateTime("created", "hour", pytz.timezone("UTC"))).values("hour", "createdBy__username", "createdBy__id").annotate(relation_count=Count('id')).order_by("-hour", "createdBy")
combined_data={}
recent_appellations = Appellation.objects.annotate(hour=DateTime("created", "hour", pytz.timezone("UTC")))\
.values("hour", "createdBy__username", "createdBy__id")\
.annotate(appelation_count=Count('id'))\
.order_by("-hour")
recent_relations = Relation.objects.annotate(hour=DateTime("created", "hour", pytz.timezone("UTC")))\
.values("hour", "createdBy__username", "createdBy__id")\
.annotate(relation_count=Count('id'))\
.order_by("-hour")

combined_data = OrderedDict()
for event in recent_appellations:
key = (event['hour'], event['createdBy__username'], event['createdBy__id'])
if key not in combined_data:
Expand Down
24 changes: 12 additions & 12 deletions vogon/local_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,22 @@
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
#
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'vogonweb',
# 'USER': 'vogonweb',
# 'PASSWORD': 'vogonweb',
# 'HOST': 'localhost',
# 'PORT': '5432',
# }
# }
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'vogonweb',
'USER': 'vogonweb',
'PASSWORD': 'vogonweb',
'HOST': 'localhost',
'PORT': '5432',
}
}
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
# }

AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend', # default
Expand Down

0 comments on commit c5fe012

Please sign in to comment.