First off, you shouldn't worry about URLs. I was giving you a sample URL.
Rely on the admin. If your model is registered, it will always show up.
Now, every time you save a MultiColorProduct instance, you are also saving a
Product instance. That's the way model inheritance works. It is going to be
most helpful if you actually define some fields on MultiColorProduct (cos so
far, the code you've shown offers you nothing extra, thus no advantage or
reason to even have it).
Oh, and another thing
Don't tinker with Satchmo's views. Leave those alone. Modify the templates.
If all of your Products are actually saved as MultiColorProduct instances,
you should be able to copy over Satchmo templates into your templates dir
(read existing Django docs on templates for this), and then modify them to
pull in the data of your custom products.
So, say you defined your MultiColorProduct with a field like this:
class MultiColorProduct(Product):
COLOR_CHOICES = (
('RED', 'Red'),
('BLUE', 'Blue'),
('GREEN', 'Green')
)
color_list = models.CharField(choices=COLOR_CHOICES, blank=True,
null=True)
Now, go grab the basic product template & just to start playing around, you
should be able to do something like this in the template:
{{ product.multicolorproduct.color_list }}
That will then render your the color_list of that MultiColorProduct by means
of related lookups.
Hopefully, that gets you started on templates.
If you find that you really want to start doing some fancy stuff with how
you return products to the Satchmo templates -- for example, you want to
actually return the MultiColorProduct instance instead of the Product
instance -- start writing your own views. But I'd recommend leaving
Satchmo's views alone. You'll thank yourself later when you only have your
small set of custom views to manage & maintain & don't have to remember
which Satchmo view you tinkered with to get something on the page when/if it
blows up.
Best,
Bob
On Wed, Aug 19, 2009 at 11:06 AM, Lagg <[email protected]> wrote:
>
> Thanks all! I finally got it figured out.
>
> It was a combination correctly registering with the admin (it's been
> many months since I last messed with Django, and I don't know as much
> as I think I do) and then actually finding the correct URL!
>
> How will this new product work with the existing templates on the user
> side (they are bone stock at the moment) ? Will the templates pick
> multicolorproducts up (I have my doubts) or will I need to do some
> work? If the templates won't pick them up, then I suspect I'll also
> have to tinker with the views?
>
> Again, thank you all.
>
> On Aug 19, 10:00 am, C <[email protected]> wrote:
> > What django application is 'MultiColorProduct' a part of?
> > Unless you are very masochistic and went editing satchmo source code
> > it's going to be in something like 'myproductextension' instead of
> > 'product'.
> >
> > Now find 'myproductextension' or whatever you called the app in /
> > admin.
> > Now find 'MultiColoredProduct' in that section.
> >
> > As much as you may think that 'MultiColoredProduct' should be part of
> > the 'product' application, it isn't. If you keep looking for it in
> > the 'product' application, you won't find it.
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---