Merge branch 'main' into storefront-next
This commit is contained in:
commit
ba90b98455
4 changed files with 25 additions and 9 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
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ class ProductAdmin(FieldsetsMixin, BasicModelAdmin):
|
|||
("brand", DALFRelatedFieldAjax),
|
||||
("category", DALFRelatedFieldAjax),
|
||||
("tags", DALFRelatedFieldAjax),
|
||||
("stocks__vendor", DALFRelatedFieldAjax),
|
||||
("stocks__vendor", DALFRelatedOnlyField),
|
||||
"created",
|
||||
"modified",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -57,10 +57,26 @@ 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": "core:sitemap-detail",
|
||||
},
|
||||
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",
|
||||
),
|
||||
path("sitemap-<section>.xml", sitemap_detail, {"sitemaps": sitemaps}, name="sitemap-detail"),
|
||||
path("sitemap-<section>-<int:page>.xml", sitemap_detail, {"sitemaps": sitemaps}, name="sitemap-detail"),
|
||||
path("download/<str:order_product_uuid>/", download_digital_asset_view, name="download_digital_asset"),
|
||||
path("search/", GlobalSearchView.as_view(), name="global_search"),
|
||||
path("app/cache/", CacheOperatorView.as_view(), name="cache_operator"),
|
||||
|
|
|
|||
|
|
@ -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