Product Inheritance

5 views
Skip to first unread message

Simon Meers

unread,
May 14, 2010, 4:27:07 AM5/14/10
to satchmo-d...@googlegroups.com
Hi Satchmo People,

This is my first of what will hopefully turn out to be many posts to
this group. I've been developing e-Commerce sites with Django for some
time now, but have so far managed to steer clear of the Satchmo
juggernaut by using my own custom applications. I've decided to give
Satchmo a chance in the hope of contributing to a standardised project
which can benefit the whole Django community.

In its current form, Satchmo is unusable (or requires some very ugly
hacking) for meeting the requirements of most of my clients. I'm
hoping to help patch it up to solve this and get on board for the long
term.

The first issue I'd like to address is Product inheritance, which I
realise is an issue with a degree of history (e.g. [1]). The current
documentation and system for Custom Product Modules seems desperately
lacking [2]. I've put an initial patch together [3] which allows
Product to be inherited with easy resolution of the subclass and
provision of an optional `template` attribute. The documentation in
the changeset demonstrates the usage. As far as I can tell it is
completely unobtrusive and backwards compatible, apart from the extra
column in product_product. I would have added a south migration for
this, but the product application migrations are not currently in a
usable state [4].

I've not submitted a pull-request yet as I thought I'd get some
opinions first in case people have better ideas. I've also not yet
added tests, but will do this if/when things go forward.

If all goes well, my next job after improving the inheritance system
(which takes more than just this initial patch) is to allow ManyToMany
sharing of Products between Sites.

Cheers,
Simon

[1] http://groups.google.com/group/satchmo-developers/browse_thread/thread/60e059a99fd4379c/42080bb99f30e340
[2] http://bitbucket.org/chris1610/satchmo/issue/1151/
[3] http://bitbucket.org/drmeers/satchmo/changeset/2be225139dd3
[4] http://bitbucket.org/chris1610/satchmo/issue/1152/

--
You received this message because you are subscribed to the Google Groups "Satchmo developers" group.
To post to this group, send email to satchmo-d...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-developers?hl=en.

Chris Moffitt

unread,
May 16, 2010, 8:11:32 PM5/16/10
to satchmo-d...@googlegroups.com
Welcome to the Satchmo group.

I do agree that the  current method for extending the Satchmo model is not as robust as it needs to be. I spent a couple minutes looking at your proposed patch and method for subclassing the models. I haven't played with it in detail but it does look pretty good.

I'd like to have some other folks take a look at it and give some comments but like I said the initial take looks very promising.

As far as timing, this is something I would propose after 0.9.2 but could see it as a viable 1.0 thing.

Thanks again and I look forward to seeing what other things you plan to work on.

-Chris

Janusz Harkot

unread,
May 17, 2010, 1:56:10 AM5/17/10
to satchmo-d...@googlegroups.com

> If all goes well, my next job after improving the inheritance system
> (which takes more than just this initial patch) is to allow ManyToMany
> sharing of Products between Sites.
When you will touch this, please do not forget to look at the translations for the product too - as this is frequently needed with configurations with multiple sites.

regards,
Janusz

Simon Meers

unread,
May 20, 2010, 7:17:42 PM5/20/10
to satchmo-d...@googlegroups.com, bobwa...@gmail.com
Thanks for the feedback Chris.

On 17 May 2010 10:11, Chris Moffitt <ch...@moffitts.net> wrote:
> I do agree that the  current method for extending the Satchmo model is not
> as robust as it needs to be. I spent a couple minutes looking at your
> proposed patch and method for subclassing the models. I haven't played with
> it in detail but it does look pretty good.
>
> I'd like to have some other folks take a look at it and give some comments
> but like I said the initial take looks very promising.

Anyone?

Bob, I've read that you've played with Product subclassing before, how
did you handle custom templates per subclass, subclass resolution,
etc? Does this look useful to you?

> As far as timing, this is something I would propose after 0.9.2 but could
> see it as a viable 1.0 thing.

I don't think there would be any harm in including it sooner -- I
don't see any compatibility issues apart from the migration (now
included), and given the current state of the Custom Product
system/documentation [1], I think sooner would be better? If folks are
happy with the approach, I can fix up the documentation, etc.

Cheers,
Simon

[1] http://bitbucket.org/chris1610/satchmo/issue/1151/

Stuart Laughlin

unread,
May 21, 2010, 12:00:08 AM5/21/10
to satchmo-d...@googlegroups.com
On Thu, May 20, 2010 at 6:17 PM, Simon Meers <drm...@gmail.com> wrote:
>
>> I'd like to have some other folks take a look at it and give some comments
>> but like I said the initial take looks very promising.
>
> Anyone?
>

FWIW I'm very interested; it's just that I'm even more busy! Sorry I
don't have much of anything intelligent/informed to say about this
right now. I am using a custom product model in the satchmo rollout in
which I'm currently engaged (using model inheritance versus OneToOne).
Hopefully I'll get a chance soon to have a look at what you've done
soon, Simon.


--Stuart

Brian Johnson

unread,
May 22, 2010, 9:39:13 PM5/22/10
to satchmo-d...@googlegroups.com
I should probably chime in here with some ancient history/perspective.

I'm the one originally to blame for the different Product models and the OneToOne fields connecting them together. I haven't been following the list, or the code changes, at all for awhile now (~2007). Somehow I started getting posts again and this title caught my eye. Since I'm not involved with the project anymore (and don't expect to be anytime soon), I don't expect my opinion to carry a whole lot of weight.

Anyway, back when this was setup, this was the only way I could come up with to get anything like model inheritance.  The real model inheritance that's in Django didn't exist yet.  It had been mentioned on the mailing list as something that might be added in the future, but it wasn't clear if it was going to actually happen or not.  As a result this whole OneToOneField mess is a workaround for not having model inheritance.

Considering that this was originally a weak attempt at model inheritance, anything that starts moving it towards using real model inheritance would be a welcome improvement in my mind.

Simon Meers

unread,
Jun 17, 2010, 2:33:21 AM6/17/10
to satchmo-d...@googlegroups.com
After a month of waiting on this, I'm thinking of focusing my efforts elsewhere (probably back to my own in-house apps); it looks like the Satchmo community might be a bit too stagnant to take on the improvements I require/supply in the necessary timeframe. I understand we're all way too busy with other things, and those who already have Satchmo stores operational are happy to just let them keep ticking away in their current state. If I were in that boat, I probably wouldn't be setting aside time to look into improvements like these either.

Cheers,
Simon

Bruce Kroeze

unread,
Jun 17, 2010, 3:00:48 AM6/17/10
to satchmo-d...@googlegroups.com
I didn't pipe up because I basically agreed with Chris.  If we can actually have a migration path, and get Satchmo more inline with current Django best-practices, I'd be enormously happy.  It is really something we need to do at some point, probably sooner rather than later.

I wouldn't call Satchmo development stagnant, I think we just released a new version, and are regrouping a bit.  I know I have tons of work to do to bring Bursar up to trunk compatibility, for example.

--
You received this message because you are subscribed to the Google Groups "Satchmo developers" group.
To post to this group, send email to satchmo-d...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-developers?hl=en.



--
Bruce Kroeze
http://www.ecomsmith.com
It's time to hammer your site into shape.

Chris Moffitt

unread,
Jun 17, 2010, 8:44:05 AM6/17/10
to satchmo-d...@googlegroups.com
I agree with Bruce's comments. I like the general direction. I just haven't taken the time to think it all through and make sure I understand the migration path. Don't take the lack of activity as lack of interest.

Hang in there and I'll try to take a look.

-Chris

Mgan59

unread,
Jun 18, 2010, 10:28:00 AM6/18/10
to Satchmo developers
I don't think the community is stagnant. I'm a long time php /
magnento fanboy that just recently switched to django and have been
exploring satchmo, so in my mind the community is growing still if I'm
here. I think most of us are busy with real-time jobs and for many
this is just a side project. I watched some video-presentation that
discussed how the concept for satchmo evolved - several programmers
wives wanted an e-commerce site, which is exactly the boat I'm in.

I wish I knew more about satchmo, I've only really worked through the
template integration of my project and have yet to delve into the
product system. That is actually next on my list. Hopefully once I
get into that portion I'll be able to provide some feed back regarding
the proposed changes. Though I've only been working with django a few
months now and find I'm still learning.



On Jun 17, 2:33 am, Simon Meers <drme...@gmail.com> wrote:
> After a month of waiting on this, I'm thinking of focusing my efforts
> elsewhere (probably back to my own in-house apps); it looks like the Satchmo
> community might be a bit too stagnant to take on the improvements I
> require/supply in the necessary timeframe. I understand we're all way too
> busy with other things, and those who already have Satchmo stores
> operational are happy to just let them keep ticking away in their current
> state. If I were in that boat, I probably wouldn't be setting aside time to
> look into improvements like these either.
>
> Cheers,
> Simon
>

Arek

unread,
Jun 18, 2010, 3:41:39 PM6/18/10
to satchmo-d...@googlegroups.com
> [3] http://bitbucket.org/drmeers/satchmo/changeset/2be225139dd3

Hi Simon,
The changes you are proposing solved many problems here. Thank you for sharing.

Arek

Reply all
Reply to author
Forward
0 new messages