Bob, I did notice something that may not quite work when you go the inherited route versus the "satchmo" way. Take this with a grain of salt as I could just have something messed up but here goes.
We have an extended product the way you mention in Satchmo diaries. We noticed when trying to use the order_success signal to spit out some xml into a directory, that the signal appeared to be getting called twice. In troubleshooting, we removed all custom models, disable the shipping module etc and were still getting the signal firing twice. I traded a few emails/discussions with Chris on this issue -- (they should be in the satchmo-users group still) -- and he pointed out something that the DownloadableProduct (i think) had which was a customr order_success method. Now, what appears to happen is that the checkout process iterates over all the products in the cart and searches for any subtypes of that products that have an order_success method and runs that products order_success method. however, since we didn't setup our products that way, the order_success method wasn't getting picked up by that particular piece of code. My assumption as to why the signal got called twice was that is was calling it once for the Parent product (Satchmo's model) and once for our Child Product (the inherited Product). My other assumption (and this could be way off) was that had I done it the way Satchmo intends it to be done, that our subtype product would have been found and THAT model's order_success method would have run. (for reference, here is the link to the discussion I had with Chris: http://groups.google.com/group/satchmo-users/browse_thread/thread/6f88be5a09bb6f41/6cd1799fd3c823f4?hl=en&lnk=gst&q=signal+called+twice#6cd1799fd3c823f4 ) Again, this could have been messed up because of my lack of understanding of the underlying Satchmo architecture. I will say that I still prefer the inheritance path as it cleans up the admin process a bit and feels more OO, but I worry that there may be "gotchas" involved... That being said, we worked around it and its working just fine. On Fri, Oct 23, 2009 at 3:41 PM, Bob Waycott <[email protected]> wrote: > I'd be interested to hear what specifically was not working in regards to > following my method of creating custom products via model inheritance as > documented in my Satchmo Diaries. > I'd also be more than happy to help support implementing such a method if > given enough code to see what you're trying to do. > > Cheers, > > Bob Waycott > > On Fri, Oct 23, 2009 at 2:43 PM, Ryan Headley <[email protected]>wrote: > >> Wow, thats alot to take in, but here's a thought. >> >> Since a Product for you is a Domain -- something that is custom per order >> -- perhaps your after the wrong object? >> >> Maybe what you need is not a Satchmo Product model at all but a plain old >> Django model. It would have an FK to your standard satchmo product ( or >> your "domain" product -- incase you have other products that you offer), >> another FK to the Order Id, and finally the actual domain name. >> >> Something like: >> CustomerDomain(models.Model): >> domain_name = models.URLField... (or charfield I suppose) >> order = models.ForeignKey(Order) >> product = models.ForeignKey(Product) >> >> When a customer visits the page where they'll be ordering a domain, hid >> the AddToCart button until they've entered a domain name. Then use the >> signal for satchmo_cart_add_complete ( >> http://www.satchmoproject.com/docs/svn/signals.html#satchmo-cart-add-complete) >> to save the CustomerDomain model with the product foreign key and domain >> name. >> >> Then perhaps upon order_success (yet another signal) -- update the >> CustomerDomain object with the order_id. >> >> >> Granted I may have completely misunderstood your situation, and perhaps >> I've even over-complicated a solution here. But what I don't think you want >> are custom products that get created for each "order" which is kinda what it >> sounded like you were doing. >> >> If I've misunderstood, the please ignore my response... >> >> >> On Fri, Oct 23, 2009 at 12:38 PM, Toni Mueller <[email protected]>wrote: >> >>> >>> >>> Hi! >>> >>> We're trying to re-implement our website+store with Satchmo, and are >>> having a few problems along the way. The list of products includes >>> domains in various TLDs, which need custom calculations and custom >>> fields as well, amongst them possibly a setup fee, a recurring fee, >>> maybe a transfer fee, a minimum reservation period, and maybe some more >>> (eg. in some cases, a business number). >>> >>> To comply with German law, we (think we) need to calculate and display >>> the total price for a given domain name reservation up-front, along >>> with the price components. We handle this with a custom template tag, >>> which we hand the product, and which returns the total initial price to >>> pay. >>> >>> After looking at Satchmo's stock product types, we decided to develop >>> our own custom product for this purpose. We hit a road block with the >>> approach described in the Satchmo Diaries, which appears to prevent us >>> from eg. using custom templates, so we re-did the whole product after >>> the recipe in the Satchmo docs, described here: >>> http://www.satchmoproject.com/docs/svn/custom-product.html >>> >>> Now we have a model that describes the basics of a domain, and another >>> model that carries the text field that the user should use to enter his >>> desired domain name (eg. "example", when trying to register >>> "example.com"), which is linked to the original "main" model for >>> domains. The TLD is selected via an OptionGroup (many-to-many) widget, >>> part of the main model. This sort of works, but we don't see the domain >>> name anywhere in the database. Instead, it seems that we need to pull >>> it directly from the request object in a signal handler (probably on >>> satchmo_cart_details_query). >>> >>> Earlier attempts to pull everything into one model resulted in not >>> being able to add domain products to the store, because suddenly, we >>> needed to enter the (mandatory) domain name, which we can't possibly >>> know, at the time we want to add the product to the shop. >>> >>> Somehow, this all sounds weird, and I have trouble believing that these >>> should be the right things to do. Instead, my guts feeling is that we >>> have major problems in our understanding of Satchmo. >>> >>> >>> Maybe some of you can help us out? >>> >>> TIA! >>> >>> >>> Kind regards, >>> --Toni++ >>> >>> >>> >>> >> >> >> -- >> http://www.sudovi.com/ >> http://www.twitter.com/lifewithryan >> http://www.thecommontongue.com >> http://www.lifewithryan.com/ >> >> >> >> > > > > -- http://www.sudovi.com/ http://www.twitter.com/lifewithryan http://www.thecommontongue.com http://www.lifewithryan.com/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
