[ckan-dev] RE : DatasetForm extension : has no member named resources

VENTURA Oceane OCEANE.VENTURA at atos.net
Wed May 23 12:57:43 UTC 2012


Hi,

Indeed I used the multilingual_dataset and the organization extension, but its deactivation didn't fix my problem. It seems to be caused by the custom extension.

It's really curious, because when I don't update the schema (def db_to_form_schema(self): return package_form_schema()) it's doesn't work either.

Anyway, with this solution the problem disappeared.

Thank you for your help.

Cordialement,


Océane VENTURA 
Business Development & Innovation
ATOS - Public Sector France
oceane.ventura at atos.net
River Ouest, 
80 quai Voltaire
95 877 Bezons Cedex
www.atos.net



De : ckan-dev-bounces at lists.okfn.org [mailto:ckan-dev-bounces at lists.okfn.org] De la part de David Raznick
Envoyé : mercredi 23 mai 2012 13:02
À : CKAN Development Discussions
Objet : Re: [ckan-dev] RE : DatasetForm extension : has no member named resources

Hello

This is a bit mysterious. Are you using the multilingual_dataset extension?

The quick fix solution is to copy this https://github.com/okfn/ckan/blob/master/ckan/templates/snippets/package_list.html
into your extensions templates folder in the same location i.e ckanext/datalocale/theme/templates/snippets/package_list.html 
This will override the core one.

Then you can change line 18
        <py:if test="package.resources">
to 
        <py:if test="package.get('resources',[]) ">

This is a bit odd as we have not come across this before normally the {"resources": [] .. }  is always in the dict passed to the controller.  I can not work out why it is not in this case.

David




On Wed, May 23, 2012 at 11:09 AM, VENTURA Oceane <OCEANE.VENTURA at atos.net> wrote:
Hi, 
Here is the code and the full traceback: 

https://gist.github.com/73f4838448c86b71f0c4


I've tried to use the code of the extension ckanext-ecportal. I also have to add "'isopen': [ignore_missing]" to the schema, otherwise I've got a similar error. But it can't work in this situation. 

Thanks,

Océane VENTURA
Business Development & Innovation
ATOS - Public Sector France
oceane.ventura at atos.net
River Ouest, 
80 quai Voltaire
95 877 Bezons Cedex
www.atos.net
 
________________________________________
De : ckan-dev-bounces at lists.okfn.org [ckan-dev-bounces at lists.okfn.org] de la part de David Raznick [kindly at gmail.com]
Date d'envoi : mercredi 23 mai 2012 11:11
À : CKAN Development Discussions
Objet : Re: [ckan-dev] DatasetForm extension : has no member named resources
Hello,

Could I have more information on what you have implemented in the IDatasetForm.  Could we see the code somewhere, the more information the better as this could be lots of things and I have never seen it before.  Also a full traceback would be useful as I am sure where this error is caused.

Anyway, this is probably the most complicated IDatasetForm

https://github.com/okfn/ckanext-ecportal/blob/master/ckanext/ecportal/forms.py

which may be handy as a guide.   From what you are saying it may correct to copy lines 294 to 300 in this into your db_to_from schema.  However I am not sure this sill sort out you problem without more information.

Thanks

David
On Tue, May 22, 2012 at 2:13 PM, VENTURA Oceane <OCEANE.VENTURA at atos.net> wrote:
Hi,

We are developping our own extension implementing IDatasetForm.
When an user creates a dataset and goes to his own page, an error appears :
UndefinedError: {'u'maintainer': u'', u'name': u'test1', 'isopen': <function callable at 0xb8aaae4>, u'author': u'', u'author_email': u'', u'notes': u'', u'title': u'test1', u'maintainer_email': u'', u'state': u'active', u'version': u'', u'url': u'', 'groups': [{u'title': u'Organization 1', u'id': u'5c1c76e3-7cdd-4c9d-9fc7-6339efbc21f4', u'name': u'organization-1'}], u'license_id': u''}
has no member named "resources"

What do I need to add to my schema.update() function to support dataset with or without resources? 

Thanks,

Océane VENTURA
Business Development & Innovation
ATOS - Public Sector France
01.73.26.47.92
06.32.33.25.99
oceane.ventura at atos.net
River Ouest, 
80 quai Voltaire
95 877 Bezons Cedex
www.atos.net
 
________________________________________
Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos ne pourra être engagée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être engagée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.

_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org
http://lists.okfn.org/mailman/listinfo/ckan-dev


_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org
http://lists.okfn.org/mailman/listinfo/ckan-dev




More information about the ckan-dev mailing list