Lengow/orders/models.py

28 lines
1.3 KiB
Python
Raw Normal View History

# 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)
2016-02-14 20:40:28 +00:00
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
2016-02-14 20:40:28 +00:00
order_purchase = models.DateTimeField(null=True, blank=True)
order_amount = models.FloatField()
2016-02-14 20:40:28 +00:00
order_tax = models.FloatField(null=True, blank=True)
order_shipping = models.FloatField()
order_commission = models.FloatField()
order_processing_fee = models.FloatField()
2016-02-14 20:40:28 +00:00
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()