Add geo iso model

This commit is contained in:
Yogesh Ojha
2022-07-09 11:41:25 +05:30
parent d0a7c40ac7
commit ba87e73c93
2 changed files with 33 additions and 0 deletions
@@ -0,0 +1,26 @@
# Generated by Django 3.2.4 on 2022-07-09 06:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('startScan', '0026_auto_20220526_1506'),
]
operations = [
migrations.CreateModel(
name='CountryISO',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(blank=True, max_length=10)),
],
),
migrations.AddField(
model_name='ipaddress',
name='geo_iso',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='startScan.countryiso'),
),
]
+7
View File
@@ -415,11 +415,18 @@ class Technology(models.Model):
return str(self.name)
class CountryISO(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=10, blank=True)
class IpAddress(models.Model):
id = models.AutoField(primary_key=True)
address = models.CharField(max_length=100, blank=True, null=True)
is_cdn = models.BooleanField(default=False)
ports = models.ManyToManyField('Port', related_name='ports')
geo_iso = models.ForeignKey(
CountryISO, on_delete=models.CASCADE, null=True, blank=True)
# this is used for querying which ip was discovered during subcan
ip_subscan_ids = models.ManyToManyField('SubScan', related_name='ip_subscan_ids')