also save instance description

This commit is contained in:
Tao Bojlen 2018-08-29 20:04:03 +02:00
parent 6526facdc9
commit 3cbc4dd1b6
3 changed files with 20 additions and 0 deletions

View file

@ -84,6 +84,7 @@ class Command(BaseCommand):
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['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['status'] = get_key(data, ['status'])
instance, _ = Instance.objects.update_or_create(

View 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),
),
]

View file

@ -6,6 +6,7 @@ class Instance(models.Model):
name = models.CharField(max_length=200, primary_key=True)
# Details
description = models.TextField(blank=True)
domain_count = models.IntegerField(blank=True, null=True)
status_count = models.IntegerField(blank=True, null=True)
user_count = models.IntegerField(blank=True, null=True)