Remove temporary test scripts from git
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
import os, sys, django
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
|
||||
django.setup()
|
||||
|
||||
from products.models.kits import ConfigurableKitProduct
|
||||
from django_tenants.utils import tenant_context
|
||||
from tenants.models import Client
|
||||
|
||||
client = Client.objects.get(schema_name='grach')
|
||||
with tenant_context(client):
|
||||
print("=" * 80)
|
||||
print("ConfigurableKitProduct items with kit bindings:")
|
||||
print("=" * 80)
|
||||
|
||||
for product in ConfigurableKitProduct.objects.all().order_by('-id')[:5]:
|
||||
attrs = product.parent_attributes.all()
|
||||
if attrs.exists():
|
||||
kit_bound = attrs.filter(kit__isnull=False).count()
|
||||
print(f"\nID {product.id}: {product.name}")
|
||||
print(f" Total attrs: {attrs.count()} | Kit-bound: {kit_bound}")
|
||||
for param_name in attrs.values_list('name', flat=True).distinct():
|
||||
vals = attrs.filter(name=param_name)
|
||||
print(f" {param_name}:")
|
||||
for attr in vals:
|
||||
kit = attr.kit.name if attr.kit else "(no kit)"
|
||||
print(f" - {attr.option} -> {kit}")
|
||||
Reference in New Issue
Block a user