import new kw

This commit is contained in:
IGNY8 VPS (Salman)
2026-02-25 17:26:03 +00:00
parent 264d98f146
commit 35d60247ad
4 changed files with 164 additions and 10 deletions

View File

@@ -0,0 +1,17 @@
# Generated by Django 5.2.10 on 2026-02-25 17:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('igny8_core_auth', '0036_add_paypal_plan_id_to_plan'),
]
operations = [
migrations.AlterUniqueTogether(
name='seedkeyword',
unique_together={('keyword', 'industry', 'sector', 'country')},
),
]

View File

@@ -781,7 +781,7 @@ class SeedKeyword(models.Model):
class Meta:
db_table = 'igny8_seed_keywords'
unique_together = [['keyword', 'industry', 'sector']]
unique_together = [['keyword', 'industry', 'sector', 'country']]
verbose_name = 'Seed Keyword'
verbose_name_plural = 'Global Keywords Database'
indexes = [

View File

@@ -155,15 +155,20 @@ class KeywordImporter:
return True
# Create keyword
SeedKeyword.objects.create(
keyword=keyword,
industry=industry,
sector=sector,
volume=volume,
difficulty=difficulty,
country=country,
is_active=True
)
try:
SeedKeyword.objects.create(
keyword=keyword,
industry=industry,
sector=sector,
volume=volume,
difficulty=difficulty,
country=country,
is_active=True
)
except Exception as e:
self.log(f" ⚠ Error creating: {keyword} [{country}]: {e}", force=True)
self.stats['errors'] += 1
return False
self.log(f" ✓ Imported: {keyword} [{country}] (vol:{volume}, diff:{difficulty})")
return True