Skip to content

Commit 02ca7cb

Browse files
authored
Merge pull request #922 from NASA-IMPACT/921-add-included-urls-to-collection-model
921 add included urls to collection model
2 parents 1df2a24 + b2dc591 commit 02ca7cb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sde_collections/models/collection.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
from django.dispatch import receiver
99
from model_utils import FieldTracker
1010
from slugify import slugify
11+
from django.db import models
12+
from django.db.models import Q
1113

1214
from config_generation.db_to_xml import XmlEditor
1315

@@ -17,6 +19,7 @@
1719
format_slack_message,
1820
send_slack_message,
1921
)
22+
from .candidate_url import CandidateURL
2023
from .collection_choice_fields import (
2124
ConnectorChoices,
2225
CurationStatusChoices,
@@ -106,6 +109,10 @@ def add_to_public_query(self):
106109
scraper_content = scraper_editor.update_config_xml()
107110
gh.create_or_update_file(query_path, scraper_content)
108111

112+
@property
113+
def included_urls_count(self):
114+
return CandidateURL.objects.filter(collection=self, excluded=False).count()
115+
109116
@property
110117
def _scraper_config_path(self) -> str:
111118
return f"sources/scrapers/{self.config_folder}/default.xml"

0 commit comments

Comments
 (0)