From b74b87d78da7c089a8fe8dfcaa5e69f8cb943905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=20=D0=93=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=D1=85?= Date: Wed, 30 Oct 2019 17:23:45 +0300 Subject: [PATCH] Add products model in transfer --- apps/product/management/__init__.py | 0 apps/product/management/commands/__init__.py | 0 .../management/commands/add_product.py | 0 apps/product/old_models.py | 0 apps/transfer/models.py | 42 +++++++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 apps/product/management/__init__.py create mode 100644 apps/product/management/commands/__init__.py create mode 100644 apps/product/management/commands/add_product.py create mode 100644 apps/product/old_models.py diff --git a/apps/product/management/__init__.py b/apps/product/management/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/apps/product/management/commands/__init__.py b/apps/product/management/commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/apps/product/management/commands/add_product.py b/apps/product/management/commands/add_product.py new file mode 100644 index 00000000..e69de29b diff --git a/apps/product/old_models.py b/apps/product/old_models.py new file mode 100644 index 00000000..e69de29b diff --git a/apps/transfer/models.py b/apps/transfer/models.py index 0f7d3348..fecbc48b 100644 --- a/apps/transfer/models.py +++ b/apps/transfer/models.py @@ -841,3 +841,45 @@ class Ads(MigrateMixin): class Meta: managed = False db_table = 'ads' + +class Products(models.Model): + establishment = models.ForeignKey('Establishments', models.DO_NOTHING, blank=True, null=True) + brand = models.CharField(max_length=255, blank=True, null=True) + name = models.CharField(max_length=255, blank=True, null=True) + vintage = models.CharField(max_length=255, blank=True, null=True) + type = models.CharField(max_length=255, blank=True, null=True) + unique_key = models.CharField(max_length=255, blank=True, null=True) + price = models.FloatField(blank=True, null=True) + average_price_in_shops = models.FloatField(blank=True, null=True) + fra_encima_id = models.IntegerField(blank=True, null=True) + wine_sub_region_id = models.IntegerField(blank=True, null=True) + classification = models.ForeignKey('WineClassifications', models.DO_NOTHING, blank=True, null=True) + wine_region = models.ForeignKey('WineLocations', models.DO_NOTHING, blank=True, null=True) + wine_type = models.ForeignKey('WineTypes', models.DO_NOTHING, blank=True, null=True) + wine_color = models.ForeignKey('WineColors', models.DO_NOTHING, blank=True, null=True) + appellation = models.ForeignKey('WineClassifications', models.DO_NOTHING, blank=True, null=True) + created_at = models.DateTimeField() + updated_at = models.DateTimeField() + state = models.CharField(max_length=255, blank=True, null=True) + wine_style = models.ForeignKey('WineStyles', models.DO_NOTHING, blank=True, null=True) + village = models.ForeignKey('WineLocations', models.DO_NOTHING, blank=True, null=True) + vineyard = models.ForeignKey('WineLocations', models.DO_NOTHING, blank=True, null=True) + yard_classification = models.ForeignKey('WineClassifications', models.DO_NOTHING, blank=True, null=True) + wine_quality = models.ForeignKey('WineClassifications', models.DO_NOTHING, blank=True, null=True) + bottles_produced = models.CharField(max_length=3000, blank=True, null=True) + deu_import_id = models.IntegerField(blank=True, null=True) + + class Meta: + managed = False + db_table = 'products' + + +class WineTypes(models.Model): + name = models.CharField(max_length=255, blank=True, null=True) + fra_encima_id = models.IntegerField(blank=True, null=True) + created_at = models.DateTimeField() + updated_at = models.DateTimeField() + + class Meta: + managed = False + db_table = 'wine_types'