Lengow/orders/models.py

27 lines
1.1 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: Pas de PRIMARY KEY, du coup, le sync fera des doublons
marketplace = models.CharField(max_length=10)
idFlux = models.IntegerField()
order_id = models.CharField(max_length=20)
order_mrid = models.CharField(max_length=20)
order_refid = models.CharField(max_length=20)
order_external_id = models.CharField(max_length=20, null=True)
# Colonne unique pour le order_purchase_date et order_purchase_heure because DateTime
order_purchase = models.DateTimeField(null=True)
order_amount = models.FloatField()
order_tax = models.FloatField(null=True)
order_shipping = models.FloatField()
order_commission = models.FloatField()
order_processing_fee = models.FloatField()
order_comments = models.TextField(null=True)
customer_id = models.CharField(max_length=20, null=True)
order_ip = models.GenericIPAddressField(null=True)
order_items = models.IntegerField()