From 0d5876fda537614b087e59835b76e547eb765521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xe=CC=81fir=20Destiny?= Date: Fri, 12 Feb 2016 15:03:00 +0100 Subject: [PATCH] =?UTF-8?q?D=C3=A9grossissement=20du=20model=20order,=20de?= =?UTF-8?q?s=20sous-models=20sont=20=C3=A0=20venir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- Lengow/settings.py | 1 + orders/models.py | 23 ++++++++++++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index cd843f0..12655d4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Project -# ... +db.sqlite3 +orders/migrations # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 diff --git a/Lengow/settings.py b/Lengow/settings.py index e47177d..1be6587 100644 --- a/Lengow/settings.py +++ b/Lengow/settings.py @@ -31,6 +31,7 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ + 'orders.apps.OrdersConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/orders/models.py b/orders/models.py index bd4b2ab..4de4232 100644 --- a/orders/models.py +++ b/orders/models.py @@ -1,5 +1,26 @@ +# coding=utf-8 from __future__ import unicode_literals from django.db import models -# Create your models here. + +class Order(models.Model): + # TODO: Revoir les max_length (difficile d'affirmer une limite précise avec le XML) + marketplace = models.CharField(max_length=10) + idFlux = models.IntegerField() + order_id = models.CharField(max_length=10) + order_mrid = models.CharField(max_length=10) + order_refid = models.CharField(max_length=10) + order_external_id = models.CharField(max_length=10) + # Colonne unique pour le order_purchase_date et order_purchase_heure because DateTime + # TODO: Le prendre en compte lors de la réception du XML puis de l'insertion en base + order_purchase = models.DateTimeField() + order_amount = models.FloatField() + order_tax = models.FloatField() + order_shipping = models.FloatField() + order_commission = models.FloatField() + order_processing_fee = models.FloatField() + order_comments = models.TextField() + customer_id = models.CharField(max_length=10) + order_ip = models.GenericIPAddressField() + order_items = models.IntegerField()