Dégrossissement du model order, des sous-models sont à venir

This commit is contained in:
Michel Roux 2016-02-12 15:03:00 +01:00
parent 48b6000a5e
commit 0d5876fda5
3 changed files with 25 additions and 2 deletions

3
.gitignore vendored
View File

@ -1,6 +1,7 @@
# Project # Project
# ... db.sqlite3
orders/migrations
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

View File

@ -31,6 +31,7 @@ ALLOWED_HOSTS = []
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
'orders.apps.OrdersConfig',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',

View File

@ -1,5 +1,26 @@
# coding=utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models 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()