-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/assessment dashboard statistics fix #1402
Feature/assessment dashboard statistics fix #1402
Conversation
dd6ee5f
to
ee36f15
Compare
deep/settings.py
Outdated
@@ -109,6 +109,7 @@ | |||
# SECURITY WARNING: keep the secret key used in production secret! | |||
SECRET_KEY = env('DJANGO_SECRET_KEY') | |||
|
|||
DATA_UPLOAD_MAX_NUMBER_FIELDS = None |
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.
Let's remove this
apps/assessment_registry/admin.py
Outdated
list_display = ('id', 'project', 'lead', 'created_at', 'publication_date') | ||
readonly_fields = ('created_at', 'modified_at') | ||
autocomplete_fields = ( | ||
'created_by', | ||
'modified_by', | ||
'project', | ||
'bg_countries', | ||
'locations', | ||
) |
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.
We will need to add this as well. Can you confirm with @Rup-Narayan-Rajbanshi
class StakeHolderInline(admin.TabularInline): | ||
model = AssessmentRegistryOrganization | ||
extra = 0 | ||
exclude = ('created_by', 'modified_by') |
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.
Maybe use readonly_fields here as well instead of exclude
.
apps/organization/filters.py
Outdated
@@ -42,6 +43,7 @@ def queryset(self, request, queryset): | |||
class OrganizationFilterSet(django_filters.FilterSet): | |||
search = django_filters.CharFilter(method='search_filter') | |||
used_in_project = IDFilter(method='filter_used_in_project') |
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.
We will need to update this to used_in_project_by_lead
deep/schema.py
Outdated
@@ -47,6 +47,7 @@ class Query( | |||
assessment_registry_schema.Query, | |||
# -- | |||
graphene.ObjectType | |||
|
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.
admin_level_id = graphene.Int(required=True) | ||
region = graphene.Int(required=True) | ||
geo_area = graphene.Int(required=True) |
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.
admin_level_id = graphene.Int(required=True) | |
region = graphene.Int(required=True) | |
geo_area = graphene.Int(required=True) | |
admin_level_id = graphene.ID(required=True) | |
region = graphene.ID(required=True) | |
geo_area = graphene.ID(required=True) |
return ( | ||
root.assessment_registry_qs.values("coordinated_joint") | ||
.annotate(count=Count("coordinated_joint")) | ||
.order_by("coordinated_joint") |
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.
Missing values()
stakeholder_counts = defaultdict(int) | ||
organization_type_fields = ["stakeholders__organization_type__title"] | ||
|
||
for field in organization_type_fields: | ||
stakeholders = root.assessment_registry_qs.values(field) | ||
for stakeholder in stakeholders: | ||
if organization_type_title := stakeholder.get(field): | ||
stakeholder_counts[organization_type_title] += 1 | ||
return [ | ||
StakeholderCountType( | ||
stakeholder=org_type_title, | ||
count=count, | ||
) | ||
for org_type_title, count in stakeholder_counts.items() | ||
] |
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.
Can you revisit this, we now only have a single table. Let's optimize this query.
return ( | ||
root.methodology_attribute_qs.values("data_collection_technique") | ||
.annotate(count=Count("data_collection_technique")) | ||
.order_by("data_collection_technique") |
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.
Missing values()
admin_level_id=models.F("locations__admin_level_id"), | ||
code=models.F("locations__code"), | ||
) | ||
.order_by("locations") |
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.
Missing values()
de28ff5
to
663f045
Compare
4255ae7
to
9742f02
Compare
663f045
to
bfd6a7c
Compare
- Modified the keys of all the enum field.
- Scoped assessment_registries query in project query
- Add validation for score_ratings for unique score_type - Add validation for score_analytical_density for unique sectors
bfd6a7c
to
2d088a5
Compare
- total assessment count - total stakeholder count - collection technique count - multisector and single sector assessment - filter with affected groups - filter with location,family,frequency,coordination_type,assessment_type and focus - schema added - number of assessment according to geographical area
- assessment by all time implemented - assessment per geographic area completed and so on
- assessment_per_sector_and_geoarea implemented - assessment_by_lead_organization implemented and so on
-total assessment -total collection technique -total multisector assessment -total singlesector assessment -collection technique test cases implemented
- assessment per unit of reporting implemented - assessment per sampling approach implemented - assessment per proxmity implemented
…ted ie -data collection techniques -sampling approach -proximity -unit of analysis -unit of reporting
- location key changed into geo_id - region key is added in the query - minor error fixes - geo_id chages into geoid(objects)
-Median Quality Score by Geographical Area -Median Quality score Over Time -Median Score for Each Quality Dimension
Dataloader for the Organization
-Optimized the queryset -implemented unit tests
2d088a5
to
ee31ee5
Compare
89a3d26
to
7589c65
Compare
Changes
This PR doesn't introduce any:
print
This PR contains valid:
Existing PR: #1341