feat(parsers): add proverki.gov.ru parser with sync_inspections task
- Add InspectionRecord model with is_federal_law_248, data_year, data_month fields - Add ProverkiClient with Playwright support for JS-rendered portal - Add streaming XML parser for large files (>50MB) - Add sync_inspections task with incremental loading logic - Starts from 01.01.2025 if DB is empty - Loads both FZ-294 and FZ-248 inspections - Stops after 2 consecutive empty months - Add InspectionService methods: get_last_loaded_period, has_data_for_period - Add Minpromtorg parsers (certificates, manufacturers) - Add Django Admin for parser models - Update README with parsers documentation and changelog
This commit is contained in:
32
src/apps/parsers/migrations/0002_add_proxy_model.py
Normal file
32
src/apps/parsers/migrations/0002_add_proxy_model.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# Generated by Django 3.2.25 on 2026-01-21 16:28
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('parsers', '0001_initial_parsers'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Proxy',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, db_index=True, help_text='Дата и время создания записи', verbose_name='создано')),
|
||||
('updated_at', models.DateTimeField(auto_now=True, help_text='Дата и время последнего обновления', verbose_name='обновлено')),
|
||||
('address', models.CharField(help_text='Адрес прокси (например: http://proxy:8080)', max_length=255, unique=True, verbose_name='адрес')),
|
||||
('is_active', models.BooleanField(db_index=True, default=True, help_text='Доступен ли прокси для использования', verbose_name='активен')),
|
||||
('last_used_at', models.DateTimeField(blank=True, help_text='Время последнего использования', null=True, verbose_name='последнее использование')),
|
||||
('fail_count', models.PositiveIntegerField(default=0, help_text='Количество неудачных попыток подключения', verbose_name='количество ошибок')),
|
||||
('description', models.CharField(blank=True, help_text='Описание прокси (провайдер, локация и т.д.)', max_length=255, verbose_name='описание')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'прокси',
|
||||
'verbose_name_plural': 'прокси',
|
||||
'db_table': 'parsers_proxy',
|
||||
'ordering': ['fail_count', '-last_used_at'],
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user