Skip to content

Commit

Permalink
Merge branch 'aleeexgreeen-midnight_blue-homepage'
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jan 20, 2025
2 parents cddbf52 + 813af3c commit 38ef700
Show file tree
Hide file tree
Showing 31 changed files with 945 additions and 607 deletions.
17 changes: 17 additions & 0 deletions ckan/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,23 @@ def get_featured_groups(count: int = 1) -> list[dict[str, Any]]:
return groups


@core_helper
def get_recent_datasets(count: int = 1) -> list[dict[str, Any]]:
'''Returns a list of recently modified/created datasets
'''
context: Context = {'ignore_auth': True, 'for_view': True}
data_dict = {'rows': count, 'sort': 'metadata_modified desc'}
recently_updated_datasets = logic.get_action('package_search')(context, data_dict)
return recently_updated_datasets['results']


@core_helper
def get_dataset_count() -> dict[str, int]:
stats = logic.get_action('package_search')(
{}, {"rows": 0})['count']
return stats


@core_helper
def featured_group_org(items: list[str], get_action: str, list_action: str,
count: int) -> list[dict[str, Any]]:
Expand Down
Loading

0 comments on commit 38ef700

Please sign in to comment.