Skip to content

Commit

Permalink
Adding Google Ads Code and FB Ads Code
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Mendez Quintero committed Jun 29, 2023
1 parent 1a95502 commit 7e0922b
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions AdAnalyzer/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django_countries",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
Expand Down
18 changes: 18 additions & 0 deletions dashboard/migrations/0003_empresa_pais.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
22 changes: 22 additions & 0 deletions dashboard/migrations/0004_empresa_google_ads_empresa_meta_ads.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
5 changes: 5 additions & 0 deletions dashboard/models.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -13,6 +17,7 @@ def __str__(self):
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')
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
django-countries

0 comments on commit 7e0922b

Please sign in to comment.