You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031
  1. from django.db import models
  2. from django.contrib.auth.models import User
  3. class Order(models.Model):
  4. """
  5. An order
  6. """
  7. customer = models.ForeignKey(User, related_name='orders')
  8. total_incl_tax = models.FloatField()
  9. def __unicode__(self):
  10. description = "Payment of %.2f from %s" % (self.initial_amount, self.type)
  11. if self.reference:
  12. description += " (reference: %s)" % self.reference
  13. return description
  14. #class Batch(models.Model):
  15. # order = models.ForeignKey('order.Order')
  16. # partner = models.CharField(max_length=255)
  17. # delivery_method = models.CharField(max_length=128)
  18. # # Not all batches are actually delivered (such as downloads)
  19. # delivery_address = models.ForeignKey('order.Address', null=True, blank=True)
  20. # # Whether the batch should be dispatched in one go, or as they become available
  21. # dispatch_option = models.CharField(max_length=128, null=True, blank=True)
  22. #
  23. #
  24. #class BatchLine(models.Model):
  25. # batch = models.ForeignKey('order.Batch')