Skip to content
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

Filter by resources type using checkbox #29

Merged
merged 2 commits into from
May 22, 2023

Conversation

ronitjadhav
Copy link
Collaborator

#13

  • Added a check box for each resource type
  • Filter the resource according to the checkbox

image

@ronitjadhav ronitjadhav linked an issue May 8, 2023 that may be closed by this pull request
2 tasks
@ronitjadhav ronitjadhav requested a review from ismailsunni May 8, 2023 12:23
style_checked = self.checkBoxStyle.isChecked()
model_checked = self.checkBoxModel.isChecked()

filtered_resources = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I prefer to use qsortfilterproxymodel for filtering (and search also sorting in the future). Could you try to use qsortfilterproxymodel? It's more challenging to use of course :)

Copy link
Collaborator Author

@ronitjadhav ronitjadhav May 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have implemented the qsortfilterproxymodel for filtering in the new commit.

@@ -50,6 +51,16 @@ def __init__(self, parent=None, iface=None):

self.pushButtonDownload.clicked.connect(self.download_resource)

self.checkBoxGeopackage.stateChanged.connect(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we check in the hub API, there are 5 resource types
image

It seems the API doesn't return all five resource types. Could you check it? Add the missing 2 check boxes after that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the API URL used, it only returns three types of resources.
Is there any other API I can use, or can you direct me to the place where I can find the API's.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really documented, but it's from this https://github.com/qgis/QGIS-Django/blob/master/qgis-app/api/urls.py

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will create an issue in that repo to include the other resource type also.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@ismailsunni ismailsunni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @ronitjadhav

@ismailsunni ismailsunni merged commit 1447fb9 into main May 22, 2023
@ronitjadhav ronitjadhav deleted the 13-filter-by-resources-type branch May 22, 2023 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter By Resources Type
2 participants