Skip to content
Snippets Groups Projects
Commit 7e0922b5 authored by Marcos Mendez Quintero's avatar Marcos Mendez Quintero 💬
Browse files

Adding Google Ads Code and FB Ads Code

parent 1a955024
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
# 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),
),
]
# 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),
),
]
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')
......
django-countries
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment