Skip to content
Snippets Groups Projects
Commit 5c57bfe1 authored by Agustín Céspedes's avatar Agustín Céspedes
Browse files

fix on model

parent 95856091
No related branches found
No related tags found
2 merge requests!2PROD1.0,!1PROD 0.1
# Generated by Django 4.2.2 on 2023-06-28 19:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Empresa",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("nombre", models.CharField(max_length=200)),
],
),
migrations.CreateModel(
name="Competencia",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"competidor",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="competidor",
to="dashboard.empresa",
),
),
(
"empresa",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="empresa",
to="dashboard.empresa",
),
),
],
options={
"unique_together": {("empresa", "competidor")},
},
),
]
# Generated by Django 4.2.2 on 2023-06-28 20:01
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("dashboard", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="empresa",
name="usuarios",
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL),
),
]
# 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),
),
]
# Generated by Django 4.2.2 on 2023-06-29 05:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("dashboard", "0004_empresa_google_ads_empresa_meta_ads"),
]
operations = [
migrations.AlterField(
model_name="empresa",
name="google_ads",
field=models.CharField(blank=True, max_length=200),
),
migrations.AlterField(
model_name="empresa",
name="meta_ads",
field=models.CharField(blank=True, max_length=200),
),
]
# Generated by Django 4.2.2 on 2023-06-29 05:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("dashboard", "0005_alter_empresa_google_ads_alter_empresa_meta_ads"),
]
operations = [
migrations.AlterField(
model_name="empresa",
name="google_ads",
field=models.CharField(blank=True, max_length=200, null=True),
),
migrations.AlterField(
model_name="empresa",
name="meta_ads",
field=models.CharField(blank=True, max_length=200, null=True),
),
]
# Generated by Django 4.2.2 on 2023-06-29 05:38
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("dashboard", "0006_alter_empresa_google_ads_alter_empresa_meta_ads"),
]
operations = [
migrations.AlterField(
model_name="empresa",
name="usuarios",
field=models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL),
),
]
# Generated by Django 4.2.2 on 2023-06-29 05:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("dashboard", "0007_alter_empresa_usuarios"),
]
operations = [
migrations.CreateModel(
name="Mercado",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("mercado", models.CharField(max_length=200)),
],
),
]
......@@ -22,7 +22,7 @@ class Company(models.Model):
market = models.ForeignKey(Market, on_delete=models.SET_NULL, blank=True, null=True)
country = CountryField(blank_label='(selecciona país)', null=True) # ISO 3166 for Country Codes
users = models.ManyToManyField(User, blank=True)
competitors = models.ManyToManyField('self', through='Competitor', related_name='competitor_of')
competitors = models.ManyToManyField('self', through='Competitor')
sources = models.ManyToManyField(Source, through='CompanySource', related_name='companies')
def __str__(self):
......
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