Thanks to help from the group, I was able to get a custom product
created, added to the admin, and show up in the store. (I followed
the method described here :
http://thisismedium.com/tech/satchmo-diaries-part-one/
)
The product (MultiColorProduct) I created only differs only from the
default Product in that it has a (one) ManyToManyField( called
'colors' ) so that it can have multiple colors selected (Think tie dye
tshirt).
class MultiColorProduct(Product):
objects = ProductManager()
colors = models.ManyToManyField(Color)
def __unicode__(self):
return u'%s' % self.name
Now comes actually adding my MultiColorProducts to the cart.
Question 1)
How would be the best way to display a multiselect box with the
MultiColorProducts.colors as the options?
I did this in product/product.html
<select multiple="multiple" name="colors" id="id_colors">
{% for c in product.multicolorproduct.colors.all %}
<option value="1">{{c.name}}</option>
{% endfor %}
</select>
Obviously "option value" needs to change for each product (I just
threw the code in there for proof of concept), but isn't there a more
django-esk way of getting that data displayed? A form class or model
form class of some sorts? If so, how would I get that class
instantiated since I'm taking Bob Waycott's advice and not messing
with any views.
Question 2)
How should I go about getting the custom product data saved to the
cart? Should I try to get the cart to recognize custom data as
CartDetail data? Should I extend Cart into a custom Cart model? Should
I do something completely different?
Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---