Slugs and templates:
I've just started on my own project which uses Satchmo, and for my purpose I'd like quite a different style of URLs from the default of category/[slug] and product/[slug]. What I want is more or less [category]/ through to [category]/[manufacturer]/[family]/[name]. So for example, I would have cpu/intel/core-i7/920 -- but I want it as various stages of refinement; so cpu/ will show all CPUs, cpu/intel will show Intel CPUs, cpu/intel/core-i7 will show Intel Core i7 CPUs. (All this is just the way that I'd like it for the computer retail industry.) As far as I can see, I'm going to need to do quite heavy overriding of the default Satchmo views and practically write my own - the way I've thought of is check for slug__iexact and show the product template and then slug__istartswith and show the category template. What would you say? How am I best to tackle it, or should I just leave it with boring, less useful category/product URL separation? The actual slug generation step is clearly quite simple - just overriding the save method. It's the view and template phases that I'm thinking about more. I imagine I'll also have no difficulty turning the category view template from product boxes into a table of details which is quite logically (for comparison) the more common way of displaying such things with computer retail websites.
Models:
This project of mine is ending up with lots of models - product sub-types as they become with Satchmo. Bob Waycott from Medium with his
Satchmo Diaries recommends inheritance from Product - but as far as I can see that would limit the scope of it quite drastically by removing the possibility of multiple sub-types. However, it does have its allures - is it a way which will work? Will Satchmo be heading that way at all after 1.0? Also, is there any reason all the custom types in Satchmo's core don't use an InlineModelAdmin for the Product? I figured it might be a convenient way of doing it. (I'll be wanting to exclude half the fields from each model anyway for all of mine from normal editing as they'll contain details of the product, specifications, figures, physical dimensions and things like that.)
I like what I've seen of Satchmo and sites built with it so far and am looking forward to working with it more! :-)
(It could only have been made in the first place by a Chris ;-))
Thanks,
Chris Morgan <
chris.mo...@gmail.com>
I'm good at making two things: mistakes and enemies.