TypeError "set objects are unhashable"

32 views
Skip to first unread message

joshm

unread,
Nov 17, 2008, 11:12:46 PM11/17/08
to Satchmo users
On Trunk:

Clicking on Variation Manager from the "Change Configurable Product"
screen:

TypeError at /products/product/admin/mytshirt/variations/

set objects are unhashable

Request Method: GET
Request URL: http://www.mywebsite.com/products/product/admin/mytshirt/variations/
Exception Type: TypeError
Exception Value:

set objects are unhashable

Exception Location: /usr/lib/python2.4/site-packages/satchmo/
product/
models.py in setup_variation_cache, line 1184
Python Executable: /usr/bin/python
Python Version: 2.4.3
Python Path: ['/var/www/vhosts/mywebsite.com/django_projects', '/
usr/
lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg', '/usr/lib/
python2.4/site-packages/pycrypto-2.0.1-py2.4-linux-i686.egg', '/usr/
lib/python2.4/site-packages/django_registration-0.7-py2.4.egg', '/usr/
lib/python2.4/site-packages/PyYAML-3.06-py2.4-linux-i686.egg', '/usr/
lib/python2.4/site-packages/elementtree-1.2.7_20070827_preview-
py2.4.egg', '/usr/lib/python2.4/site-packages/docutils-0.5-py2.4.egg',
'/usr/lib/python2.4/site-packages/python_memcached-1.43-py2.4.egg', '/
usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-
linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-
dynload', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/
site-
packages/PIL']
Server time: Mon, 17 Nov 2008 16:20:32 -0800


Can anyone verify if they see this?

Chris Moffitt

unread,
Nov 17, 2008, 11:28:29 PM11/17/08
to satchm...@googlegroups.com
I am seeing this too. I don't have the time right now to chase it down but it looks like a change in rev 1682 introduced the bug.

-Chris

joshm

unread,
Nov 18, 2008, 1:10:42 AM11/18/08
to Satchmo users
I think there are a couple of other issues as well, from the same
"Change Configurable Product" screen, you have your variations
present:

1) If you add all of the variations at once using the checkbox, and
then delete one or more of them, they will not be deleted from the
products table.
2) If you try to add just one item using "add variation" it will add
to the products table but it appears to not to get written to the
productvariation tables.

I haven't spent much time looking at the code to see what might be
going on, I agree that 1682 looks like the culprit for the first
issue.

I will spend some time in the morning looking.

Would you like me to open a ticket on any of this?

On Nov 17, 8:28 pm, "Chris Moffitt" <ch...@moffitts.net> wrote:
> I am seeing this too. I don't have the time right now to chase it down but
> it looks like a change in rev 1682 introduced the bug.
>
> -Chris
>

Bruce Kroeze

unread,
Nov 18, 2008, 1:45:28 AM11/18/08
to satchm...@googlegroups.com
OK, I've got it fixed, doing final tests now before committing.
--
Bruce Kroeze
http://solidsitesolutions.com
Dynamic Designs, Optimized

Bruce Kroeze

unread,
Nov 18, 2008, 12:33:34 PM11/18/08
to satchm...@googlegroups.com
On Mon, Nov 17, 2008 at 10:10 PM, joshm <joshm...@gmail.com> wrote:

I think there are a couple of other issues as well, from the same
"Change Configurable Product" screen, you have your variations
present:

1) If you add all of the variations at once using the checkbox, and
then delete one or more of them, they will not be deleted from the
products table.
2) If you try to add just one item using "add variation" it will add
to the products table but it appears to not to get written to the
productvariation tables.

All these errors are fixed as of [1709].

joshm

unread,
Nov 18, 2008, 1:06:24 PM11/18/08
to Satchmo users
I still can not seem to add a variation from this screen, it might be
because of my configuration, but when I click add variation, I go to
the "Add Product Variation" screen, (my options aren't selected, but
this might be an existing bug that is being worked on) I select my
options, and click save, it does not save. In the log file i have:

"WARNING cannot add a productvariation subtype to a product which
already is a configurableproduct. Aborting
rting"

Which doesn't seem to make too much sense, if I have a configurable
product, how is it configurable if I can't add any product
variations...

I can now get into the variation manager, but selecting anything and
clicking "Update Variation" doesn't seem to do anything.

Are you seeing this same behavior?


On Nov 18, 9:33 am, "Bruce Kroeze" <bkro...@gmail.com> wrote:

Bruce Kroeze

unread,
Nov 18, 2008, 1:14:49 PM11/18/08
to satchm...@googlegroups.com
On Tue, Nov 18, 2008 at 10:06 AM, joshm <joshm...@gmail.com> wrote:

I still can not seem to add a variation from this screen, it might be
because of my configuration, but when I click add variation, I go to
the "Add Product Variation" screen, (my options aren't selected, but
this might be an existing bug that is being worked on) I select my
options, and click save, it does not save.  In the log file i have:

"WARNING  cannot add a productvariation subtype to a product which
already is a configurableproduct. Aborting
rting"

You don't hit "add product variation" on a configurable product.  You hit it on some other product that you want to make into a variation.  Think of it as an attribute of the product.  The system is doing exactly what it is supposed to do here.  

I made a video a long time ago which gives an example of "manually" creating a product.  It may help, even though it is very out of date:  http://coderseye.com/files/satchmo/satchmo_pv.swf
 
Which doesn't seem to make too much sense, if I have a configurable
product, how is it configurable if I can't add any product
variations...

You add them from the configurable product page, or the variation manager.
 
I can now get into the variation manager, but selecting anything and
clicking "Update Variation" doesn't seem to do anything. 


Are you seeing this same behavior?

Nope, it works for me.

--
Bruce Kroeze

joshm

unread,
Nov 18, 2008, 5:11:46 PM11/18/08
to Satchmo users
Bruce,

Sorry for the troubles with this, and thank you for your help.

I'm now trying to figure out why my variation manager is not working
for me.

I logged a bit out of satchmo and here is what I found, maybe you can
point me to what is going on here:

When I go to the variation manager, I click "Select All" and then
"Update Variations"
When I log the actions I see that the method varitiation_manager in
product/adminviews.py is called
This in turn saves the request, with form.save(request)
In the Variation Manager call for save, I have this as my optiondict:
{1L: {1L: <Option: Small>, 2L: <Option: Medium>, 3L: <Option: Large>,
12L: <Option: Extra Large>, 13L: <Option: Extra Small>}, 2L: {4L:
<Option: Chocolate>, 5L: <Option: Sky>}, 5L: {14L: <Option: Ocean>,
15L: <Option: Milk Chocolate>}}

and this as my cleaned_data:

{'optiongroup__1': [u'1_13', u'1_1', u'1_2', u'1_3', u'1_12'],
'name__1_1': u'test product (S)', 'name__1_2': u'test product (M)',
'name__1_3': u'test product (L)', 'sku__1_13': u'', 'sku__1_12': u'',
'pv__1_13': True, 'pv__1_12': True, 'sku__1_3': u'', 'sku__1_2': u'',
'sku__1_1': u'', 'slug__1_12': u'test-product_XL', 'slug__1_13':
u'test-product_XS', 'pv__1_3': True, 'pv__1_2': True, 'pv__1_1': True,
'name__1_12': u'test product (XL)', 'name__1_13': u'test product
(XS)', 'dirty': u'', 'slug__1_1': u'test-product_S', 'slug__1_2':
u'test-product_M', 'slug__1_3': u'test-product_L'}

In this instance there is no dirty items, thus nothing is ever
committed to the db. (At least I think that is what is going on
here).

Do you have any ideas hints or pointers as to how to track down what
might be going on here, should there be dirty data?

Thanks in advance....




On Nov 18, 10:14 am, "Bruce Kroeze" <bkro...@gmail.com> wrote:

joshm

unread,
Nov 19, 2008, 8:01:18 PM11/19/08
to Satchmo users
I went back to a clean snapshot and reloaded the demo data, I'm still
getting this issue. It seems my configuration is correct... Anyone
have any suggestions...

Thanks.

baumer

unread,
Nov 20, 2008, 2:28:58 PM11/20/08
to Satchmo users
I think there is an issue here too. No matter what I do, I cannot add
a product variation. The second and third errors I was seeing here [1]
still stand in r1711.

http://groups.google.com/group/satchmo-users/browse_thread/thread/b9d5527ab7d293b8

--
Pete

Chris Moffitt

unread,
Nov 20, 2008, 3:48:46 PM11/20/08
to satchm...@googlegroups.com
If you try to load the sample store data, does it work?

python manage.py satchmo_load_store

I'm trying to figure out where the issue lies.

-Chris

baumer

unread,
Nov 20, 2008, 5:01:52 PM11/20/08
to Satchmo users
OK, I was able to add a product variation by what I thought was the
"old" way.

Add product, make configurable, add another product, add variation,
link new variation to original configurable product.

I believe my confusion was with the "Create Variations" check box on
the ConfigurableProduct edit page. I misunderstood the help_text there
and was confused as to why the variations were not being created. (To
me "add" an option meant "create" the option, not "select" an option).

OK, I thought, so I just click the "Add variations" link next to my
Option, select my option again on the next page (?), then save. That
500s (I'll file a bug for that) because I'm trying to add a variation
on a ConfigurableProduct.

So there is a minor bug that I'll file, but I think the rest boils
down to me not understanding the interface. I'm going to try to post a
screencast of how this works as I imagine it will help folks like me
grok this a lot sooner.

--
Pete



On Nov 20, 1:48 pm, "Chris Moffitt" <ch...@moffitts.net> wrote:
> If you try to load the sample store data, does it work?
>
> python manage.py satchmo_load_store
>
> I'm trying to figure out where the issue lies.
>
> -Chris
>
> On Thu, Nov 20, 2008 at 1:28 PM, baumer <sgt.hu...@gmail.com> wrote:
>
> > I think there is an issue here too. No matter what I do, I cannot add
> > a product variation. The second and third errors I was seeing here [1]
> > still stand in r1711.
>
> >http://groups.google.com/group/satchmo-users/browse_thread/thread/b9d...

joshm

unread,
Nov 21, 2008, 12:23:07 PM11/21/08
to Satchmo users
I was following the instructions for the variation manager as noted in
this thread:

http://groups.google.com/group/satchmo-users/browse_thread/thread/7a4318e9b8c915a2/f703a549bca87432?lnk=gst&q=option+group+key#f703a549bca87432

and with a demo store with new demo store data I can't get the
variation manager to do steps 3-5.

I create a product, make a configurable product, then go to the
variation manager:

1) Use the helper links and "Select All"
2) Click Update Variations

All the checkboxes go back to unchecked and nothing changed.

This is on a mysql/apache configuration on a vm, so I can easily tear
it down and start it from scratch.

Christopher Mitchell

unread,
Oct 2, 2014, 9:13:06 PM10/2/14
to satchm...@googlegroups.com
It is very odd that this remains a major issue, 6 years later. If any one has a fix for this, please pass along.

Thanks
Reply all
Reply to author
Forward
0 new messages