# coding=utf-8 from __future__ import unicode_literals from django.db import models class Order(models.Model): # TODO: Revoir les max_length et null (difficile d'affirmer une limite précise avec le XML) # TODO: Faire des sous-modèles pour gérer de plus d'informations venant du XML comme les adresses, # le tracking ou le panier marketplace = models.CharField(max_length=10) idFlux = models.IntegerField() order_id = models.CharField(max_length=20, primary_key=True) order_mrid = models.CharField(max_length=20) order_refid = models.CharField(max_length=20) order_external_id = models.CharField(max_length=20, null=True, blank=True) # Colonne unique pour le order_purchase_date et order_purchase_heure because DateTime order_purchase = models.DateTimeField(null=True, blank=True) order_amount = models.FloatField() order_tax = models.FloatField(null=True, blank=True) order_shipping = models.FloatField() order_commission = models.FloatField() order_processing_fee = models.FloatField() order_comments = models.TextField(null=True, blank=True) customer_id = models.CharField(max_length=20, null=True, blank=True) order_ip = models.GenericIPAddressField(null=True, blank=True) order_items = models.IntegerField()