I've created Custom Product using inheritance:
from django.db import models
from django.contrib.sites.models import Site
from product.models import Product, ProductManager, Category
SATCHMO_PRODUCT = True
def get_product_types():
return ['CampProduct']
class CampProduct(Product):
camp = models.OneToOneField('wpt.Camp')
def _get_subtype(self):
return 'CampProduct'
def __unicode__(self):
return '%s Product' % self.camp
objects = ProductManager()
def save(self, *args, **kwargs):
if not self.pk:
self.site = Site.objects.get(pk=1)
self.name = unicode(self.camp)
super(CampProduct, self).save(*args, **kwargs)
self.category.add(Category.objects.get(slug='camps'))
Now I get infinite recursion in several places. All these errors are
produced in Product::get_subtype_with_attr method. I think it does not
work properly with custom products which are inherited from base
Product class.
Have anyone experienced similar problems?
--
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.