diff --git a/AdAnalyzer/settings.py b/AdAnalyzer/settings.py index 246134690ae6a59f08d9e2cb3f9744a33e1f3b28..88c28031efaffcbe3499b9d8704c3fe358d6b1f6 100644 --- a/AdAnalyzer/settings.py +++ b/AdAnalyzer/settings.py @@ -34,6 +34,7 @@ INSTALLED_APPS = [ "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", + "django_countries", "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", diff --git a/dashboard/migrations/0003_empresa_pais.py b/dashboard/migrations/0003_empresa_pais.py new file mode 100644 index 0000000000000000000000000000000000000000..07558f878eef8da81ac096c084166986c8f8ffd4 --- /dev/null +++ b/dashboard/migrations/0003_empresa_pais.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.2 on 2023-06-29 05:24 + +from django.db import migrations +import django_countries.fields + + +class Migration(migrations.Migration): + dependencies = [ + ("dashboard", "0002_empresa_usuarios"), + ] + + operations = [ + migrations.AddField( + model_name="empresa", + name="pais", + field=django_countries.fields.CountryField(max_length=2, null=True), + ), + ] diff --git a/dashboard/migrations/0004_empresa_google_ads_empresa_meta_ads.py b/dashboard/migrations/0004_empresa_google_ads_empresa_meta_ads.py new file mode 100644 index 0000000000000000000000000000000000000000..69bbbdf0770ed48a7014d5a627c4e38cef431d62 --- /dev/null +++ b/dashboard/migrations/0004_empresa_google_ads_empresa_meta_ads.py @@ -0,0 +1,22 @@ +# Generated by Django 4.2.2 on 2023-06-29 05:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("dashboard", "0003_empresa_pais"), + ] + + operations = [ + migrations.AddField( + model_name="empresa", + name="google_ads", + field=models.CharField(max_length=200, null=True), + ), + migrations.AddField( + model_name="empresa", + name="meta_ads", + field=models.CharField(max_length=200, null=True), + ), + ] diff --git a/dashboard/models.py b/dashboard/models.py index b4c95601c4848692f6b93201181109de9ba14674..cf64ab0200d8ad4d436923bad0f6f640095c0bab 100644 --- a/dashboard/models.py +++ b/dashboard/models.py @@ -1,9 +1,13 @@ from django.db import models from django.contrib.auth.models import User +from django_countries.fields import CountryField #This is the model for Companies that are going to be registered even thought they are not clients in the system class Empresa(models.Model): nombre = models.CharField(max_length=200) + pais = CountryField(blank_label='(selecciona paÃs)', null=True) # ISO 3166 for Country Codes + google_ads = models.CharField(max_length=200, null=True) + meta_ads = models.CharField(max_length=200, null=True) usuarios = models.ManyToManyField(User) def __str__(self): @@ -13,6 +17,7 @@ class Empresa(models.Model): class Competencia(models.Model): empresa = models.ForeignKey(Empresa, related_name='empresa', on_delete=models.CASCADE) competidor = models.ForeignKey(Empresa, related_name='competidor', on_delete=models.CASCADE) + #google_ads = models.ForeignKey(Empresa, related_name='google_ads', on_delete=models.CASCADE) class Meta: unique_together = ('empresa', 'competidor') diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..31f0812ed0ff9776f213316cb6b52cf8b6aa4b3a --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +django-countries \ No newline at end of file