Features: 1) None;
Fixes: 1) Correct indentation in `api_urls.py` for better readability; 2) Update `.gitignore` to include `.nuxt/`, `.next/`, and `next-env.d.ts` paths; 3) Simplify query formatting in `delete_never_ordered_products` command; Extra: None;
This commit is contained in:
parent
4efaeaea8f
commit
cd71d78b93
3 changed files with 12 additions and 6 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -64,8 +64,9 @@ htmlcov/
|
|||
.pybuilder/
|
||||
|
||||
# Storefronts
|
||||
nuxt/
|
||||
next/
|
||||
.nuxt/
|
||||
.next/
|
||||
next-env.d.ts
|
||||
|
||||
# Celery
|
||||
celerybeat-schedule
|
||||
|
|
|
|||
|
|
@ -57,7 +57,13 @@ sitemaps = {
|
|||
urlpatterns = [
|
||||
path("core/", include(core_router.urls)),
|
||||
path(
|
||||
"sitemap.xml", sitemap_index, {"sitemaps": sitemaps, "sitemap_url_name": "sitemap-detail"}, name="sitemap-index"
|
||||
"sitemap.xml",
|
||||
sitemap_index,
|
||||
{
|
||||
"sitemaps": sitemaps,
|
||||
"sitemap_url_name": "sitemap-index"
|
||||
},
|
||||
name="sitemap-index"
|
||||
),
|
||||
path("sitemap-<section>.xml", sitemap_detail, {"sitemaps": sitemaps}, name="sitemap-detail"),
|
||||
path("sitemap-<section>-<int:page>.xml", sitemap_detail, {"sitemaps": sitemaps}, name="sitemap-detail"),
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@ from core.models import Product
|
|||
|
||||
CHUNK_SIZE = 5000
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Delete Product rows with no OrderProduct, in batches"
|
||||
|
||||
def handle(self, *args, **options):
|
||||
while True:
|
||||
batch_ids = list(
|
||||
Product.objects
|
||||
.filter(orderproduct__isnull=True)
|
||||
.values_list('pk', flat=True)[:CHUNK_SIZE]
|
||||
Product.objects.filter(orderproduct__isnull=True).values_list("pk", flat=True)[:CHUNK_SIZE]
|
||||
)
|
||||
if not batch_ids:
|
||||
break
|
||||
|
|
|
|||
Loading…
Reference in a new issue