[ckan-dev] dataset-id

Crossbreed Crossbreed at sms.at
Mon Oct 1 10:29:23 UTC 2012


<html><body><div>Hi! I would like to copy the value of the ID-field into an other field when creating a new dataset. I have an extension which the PackageController implements. In this class (method: _save_new) i tried to set the ID to  the other field, but the value of the ID seems to be "none". So, how could I set the value of the ID-field to an other field, when creating a dataset? - Where is the value of the ID-field generated?<br /> def _save_new(self, context, package_type=None):<br />...<br />         data_dict = clean_dict(unflatten(<br />                tuplize_dict(parse_params(request.POST))))<br />            data_dict['type'] = package_type<br />            context['message'] = data_dict.get('log_messag
 e', '')<br />            data_dict['testfield'] = data_dict['id']<br />            pkg = get_action('package_create')(context, data_dict)<br />            self._form_save_redirect(pkg['name'], 'new')</div>
<div> </div>
<div>...</div>
<div> </div>
<div>kind regards!</div><br/><br/><hr/>Schau dir gleich die Seite von hsdf an! <a href="http://my.sms.at/crossbreed/" target="profil_sms_at">http://my.sms.at/crossbreed/</a><br/><hr/>Dein Eventkalender auf sms.at! Events anlegen, Freunde einladen & kein Top-Event mehr verpassen! <a href="http://www.sms.at/events/">http://www.sms.at/events/</a><br/></body></html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20121001/570ebb57/attachment.html>


More information about the ckan-dev mailing list