Skip to content

Commit

Permalink
Merge branch 'dev' into feat/closed_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
rdahis authored Nov 25, 2024
2 parents b97a506 + 5b67528 commit 3a57742
Show file tree
Hide file tree
Showing 6 changed files with 535 additions and 1 deletion.
19 changes: 19 additions & 0 deletions backend/apps/api/v1/migrations/0051_add_new_field_dataset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.16 on 2024-11-13 16:59

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('v1', '0050_table_is_deprecated'),
]

operations = [
migrations.AddField(
model_name='dataset',
name='usage_guide',
field=models.TextField(blank=True, null=True, default='', max_length=255 , verbose_name='Guia de Uso')
),
]

1 change: 1 addition & 0 deletions backend/apps/api/v1/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ class Dataset(BaseModel):
default=0,
help_text="Number of page views by Google Analytics",
)
usage_guide = models.TextField(blank=True, null=True, default='', max_length=255 , verbose_name='Guia de Uso')

graphql_nested_filter_fields_whitelist = ["id", "slug"]

Expand Down
4 changes: 3 additions & 1 deletion backend/apps/api/v1/search_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def get(self, request, *args, **kwargs):
}
)

def get_facets(self, sqs: SearchQuerySet, facet_size=22):
def get_facets(self, sqs: SearchQuerySet, facet_size=200):
sqs = sqs.facet("theme_slug", size=facet_size)
sqs = sqs.facet("organization_slug", size=facet_size)
sqs = sqs.facet("spatial_coverage", size=facet_size)
Expand All @@ -165,6 +165,8 @@ def get_facets(self, sqs: SearchQuerySet, facet_size=22):
for key, values in facet_counts:
facets[key] = []
for value in values:
if not value[0]:
continue
facets[key].append(
{
"key": value[0],
Expand Down
1 change: 1 addition & 0 deletions scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
Loading

0 comments on commit 3a57742

Please sign in to comment.