Skip to content

Commit

Permalink
added filtered queryset
Browse files Browse the repository at this point in the history
  • Loading branch information
raftmsohani committed Oct 15, 2024
1 parent 542823f commit 7a0ae1b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tasks:
upload-kibana-objs:
desc: Upload dashboards to Kibana server
cmds:
- curl -X POST localhost:5601/api/saved_objects/_import -H "kbn-xsrf: true" --form file=@tdrs-backend/tdpservice/search_indexes/kibana_saved_objs.ndjson
- 'curl -X POST localhost:5601/api/saved_objects/_import -H "kbn-xsrf: true" --form file=@tdrs-backend/tdpservice/search_indexes/kibana_saved_objs.ndjson'

create-network:
desc: Create the external network
Expand Down
3 changes: 2 additions & 1 deletion tdrs-backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ services:
- ELASTICSEARCH_LOG_INDEX_SLOW_THRESHOLD_INFO
- ELASTICSEARCH_LOG_INDEX_SLOW_THRESHOLD_TRACE
- ELASTICSEARCH_LOG_INDEX_SLOW_LEVEL
- ENABLE_SENTRY
volumes:
- .:/tdpapp
- logs:/tdpapp
- logs:/logs
image: tdp-backend
build: .
command: >
Expand Down
7 changes: 6 additions & 1 deletion tdrs-backend/tdpservice/parsers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ class ParserErrorAdmin(admin.ModelAdmin):
'error_type',
'error_message',
]


def get_queryset(self, request):
"""Override the queryset to include the related datafile."""
queryset = super().get_queryset(request).only('row_number', 'field_name', 'error_type', 'error_message',)
print('__________________', queryset.explain())
return queryset

class DataFileSummaryAdmin(admin.ModelAdmin):
"""ModelAdmin class for DataFileSummary objects generated in parsing."""
Expand Down
7 changes: 5 additions & 2 deletions tdrs-backend/tdpservice/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ class Local(Common):
'level': 'DEBUG',
'handlers': ['console']
}

INSTALLED_APPS = Common.INSTALLED_APPS + (
#'debug_toolbar',
)

REDIS_SERVER_LOCAL = bool(strtobool(os.getenv("REDIS_SERVER_LOCAL", "TRUE")))

if os.getenv("ENABLE_SENTRY", "no") == "yes":
Expand All @@ -53,7 +56,7 @@ class Local(Common):
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
sentry_sdk.init(
dsn="http://[email protected]:9001/2",
dsn="http://[email protected]:9001/1",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
integrations=[
Expand Down

0 comments on commit 7a0ae1b

Please sign in to comment.