'list' object has no attribute 'iteritems' while creating an Offering
grubert65 opened this issue · comments
We use the USDL linked with the offering that can be found in the WStore online instance.
I suppose that you have have used the master branch, this bug is fixed in develop branch. This was a problem with the creation of lucene indexes.
I have the same issue into develop branch. I'm not sure it is due to indexing, create_index is called after offering has been init, i added to print into src/wstore/offerings/offerings_management.py, one before Offering.objects.create and one just after, next is my output (after is not printed):
[21/Oct/2013 07:10:05] "GET /logout HTTP/1.1" 302 0
[21/Oct/2013 07:10:05] "GET /login?next=/ HTTP/1.1" 200 2659
[21/Oct/2013 07:10:05] "GET /static/assets/css/store/core.css HTTP/1.1" 200 8474
/usr/lib/python2.6/site-packages/django/db/models/fields/init.py:796: RuntimeWarning: DateTimeField received a naive datetime (2013-10-18 13:29:50.026000) while time zone support is active.
RuntimeWarning)
[21/Oct/2013 07:10:12] "POST /login HTTP/1.1" 302 0
[21/Oct/2013 07:10:12] "GET / HTTP/1.1" 200 41514
[21/Oct/2013 07:10:12] "GET /static/wstore/js/store/StoreView.js HTTP/1.1" 200 11398
[21/Oct/2013 07:10:12] "GET /api/administration/profiles/anaselli HTTP/1.1" 200 386
[21/Oct/2013 07:10:12] "GET /api/offering/offerings/toprated HTTP/1.1" 200 2
[21/Oct/2013 07:10:12] "GET /api/offering/offerings/newest HTTP/1.1" 200 2
[21/Oct/2013 07:10:34] "GET /catalogue HTTP/1.1" 200 40853
[21/Oct/2013 07:10:34] "GET /static/wstore/js/catalogue/CatalogueView.js HTTP/1.1" 200 12018
[21/Oct/2013 07:10:35] "GET /api/administration/profiles/anaselli HTTP/1.1" 200 386
[21/Oct/2013 07:10:35] "GET /api/offering/offerings?filter=purchased&action=count HTTP/1.1" 200 13
[21/Oct/2013 07:10:35] "GET /api/offering/offerings?filter=purchased&limit=10&start=1 HTTP/1.1" 200 2
[21/Oct/2013 07:10:38] "GET /api/administration/repositories HTTP/1.1" 200 87
[21/Oct/2013 07:11:25] "GET /api/offering/resources HTTP/1.1" 200 2
before Offering.objects.create
[21/Oct/2013 07:11:26] "POST /api/offering/offerings HTTP/1.1" 400 76
Hi, I have tried to create an offering with the USDL we provide and the code published here and I cannot reproduce the problem.
Taking into account, the error you get and the prints output you have include, it seems that a list is being included as parameter to Offering.object.create while a dict is expected.
Could you please try to debug step by step and tell me the values of the parameters included in the offering?
Hi, I have found the problem, the json-ld lib that is used to serialize the UDSL has changed. The property compact that is used to have the default contex has changed to auto_compact, that is why the offering description field is containing a list instead of a dict. The problem is now fixed so if you update you version it should work.
I will check it asap. Thank you very much.
Fixed, I think you can close this issue. Thanks