Have a look at
http://juanjoalvarez.net/es/detail/2009/jul/27/why-bad-idea-tm-override-product-model-satchmo/
specially the admin inline, it is a nice post!

Mutaz

On Mon, Dec 21, 2009 at 3:36 PM, cc <[email protected]> wrote:

> Chris, do you know if I would be able to query for these attributes
> directly using QuerySets?  I will have to think through my use case to
> see if I have the need, but I'm not sure how it would be possible
> given the Product Attributes implementation.
>
> If I can't and I do need to be able to query these extra attributes,
> what method would you recommend?  Custom Product Modules or
> Inheritance?
>
> On Dec 21, 9:10 am, Chris Moffitt <[email protected]> wrote:
> > If you are developing on trunk, you may want to take a look at using
> Custom
> > Product Attributes -
> http://www.satchmoproject.com/docs/svn/product-attributes.html
> >
> > These are meant to be simple data fields that you attach to your models
> to
> > store additional information. The nice thing is that you can write custom
> > validations for them if you need to. It's meant to be used in cases like
> > this where you only need one or two additional pieces of info on a
> product.
> >
> > -Chris
> >
> > On Mon, Dec 21, 2009 at 12:15 AM, cc <[email protected]> wrote:
> > > Hello, I have a use-case where I need to add fields to most (if not
> > > all) of my products.  I came across Custom Product Modules in the docs
> > > and I was able to register the type and see it in the admin.
> >
> > > It seems to be what I'm looking for but I have a feeling that since my
> > > fields are a simple extension to the vanilla Product type, wouldn't it
> > > be much easier to just inherit from Product so I can instantiate
> > > MyProduct directly and access Product's fields directly?  Not sure if
> > > these "Custom Product Modules" were added before django 1.1 to provide
> > > this functionality or not, but it seems model inheritance is much
> > > better.
> >
> > > Also, when using MyProduct, I wasn't able to access the 'product'
> > > member as it didn't exist right after instantiating (and before
> > > saving).  I'm not even sure how to programmatically add products using
> > > MyProduct.
> >
> > > Also tried: p = new Product()
> > > p.site = current site
> > > p.name = 'test'
> > > p.save()
> >
> > > and I still couldn't access p.myproduct.  Got the exception
> > > DoesNotExist...
> >
> > > Any help is appreciated.
> >
> > > Thanks
> >
> > > --
> >
> > > 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]<satchmo-users%[email protected]>
> <satchmo-users%[email protected]<satchmo-users%[email protected]>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/satchmo-users?hl=en.
>
> --
>
> 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]<satchmo-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/satchmo-users?hl=en.
>
>
>

--

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.


Reply via email to