Product customtext field length inconsistency

Create issue
Issue #1292 new
phazlett created an issue

CartItemDetails.value is declared as a TextField whereas OrderItemDetail is declared as CharField(max_length=255).

If you have a product with a custom text field AND the value of the custom text field is > 255 characters you can successfully add the product to your shopping cart. However, the custom text is truncated to 255 characters when you checkout and the shopping cart item is copied to an order item.

Here is a proposed patch to fix the inconsistency in the OrderItemDetail model.

{{{ --- 2011-03-08 14:52:33.452872002 -0500 +++ 2011-03-29 13:17:13.561744002 -0400 @@ -1189,7 +1189,7 @@ """ item = models.ForeignKey(OrderItem, verbose_name=("Order Item"), ) name = models.CharField(('Name'), max_length=100) - value = models.CharField(('Value'), max_length=255) + value = models.TextField(('Value')) price_change = CurrencyField(("Price Change"), max_digits=18, decimal_places=10, blank=True, null=True) sort_order = models.IntegerField(("Sort Order"), help_text=_("The display order for this group.")) }}}

Comments (0)

  1. Log in to comment