also save instance description
This commit is contained in:
parent
6526facdc9
commit
3cbc4dd1b6
|
@ -84,6 +84,7 @@ class Command(BaseCommand):
|
||||||
defaults['domain_count'] = get_key(data, ['info', 'stats', 'domain_count']) or None
|
defaults['domain_count'] = get_key(data, ['info', 'stats', 'domain_count']) or None
|
||||||
defaults['status_count'] = get_key(data, ['info', 'stats', 'status_count']) or None
|
defaults['status_count'] = get_key(data, ['info', 'stats', 'status_count']) or None
|
||||||
defaults['user_count'] = get_key(data, ['info', 'stats', 'user_count']) or None
|
defaults['user_count'] = get_key(data, ['info', 'stats', 'user_count']) or None
|
||||||
|
defaults['description'] = get_key(data, ['info', 'description'])
|
||||||
defaults['version'] = get_key(data, ['info', 'version'])
|
defaults['version'] = get_key(data, ['info', 'version'])
|
||||||
defaults['status'] = get_key(data, ['status'])
|
defaults['status'] = get_key(data, ['status'])
|
||||||
instance, _ = Instance.objects.update_or_create(
|
instance, _ = Instance.objects.update_or_create(
|
||||||
|
|
18
scraper/migrations/0002_instance_description.py
Normal file
18
scraper/migrations/0002_instance_description.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 2.1 on 2018-08-29 18:01
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('scraper', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='instance',
|
||||||
|
name='description',
|
||||||
|
field=models.TextField(blank=True),
|
||||||
|
),
|
||||||
|
]
|
|
@ -6,6 +6,7 @@ class Instance(models.Model):
|
||||||
name = models.CharField(max_length=200, primary_key=True)
|
name = models.CharField(max_length=200, primary_key=True)
|
||||||
|
|
||||||
# Details
|
# Details
|
||||||
|
description = models.TextField(blank=True)
|
||||||
domain_count = models.IntegerField(blank=True, null=True)
|
domain_count = models.IntegerField(blank=True, null=True)
|
||||||
status_count = models.IntegerField(blank=True, null=True)
|
status_count = models.IntegerField(blank=True, null=True)
|
||||||
user_count = models.IntegerField(blank=True, null=True)
|
user_count = models.IntegerField(blank=True, null=True)
|
||||||
|
|
Loading…
Reference in a new issue