[ckan-dev] Issue 334 edit related on /app

Sean Hammond sean.hammond at okfn.org
Wed Feb 20 09:29:14 UTC 2013


> Currently the edit url looks like /package/XXX/related/edit/YYY where
> XXX is the dataset id of the item and YYY is the id of the related
> item.

Not all related items belong to a dataset, so maybe this should change.
On publicdata.eu for example, none of the related items on the /apps
page (also on the front page) belong to a dataset.

> So on the /app url we would need to supply the dataset id to get the
> edit button (in fact if we passed the dataset id we would indeed get an
> edit button) however the snippets assume that we pass the package id
> (which is identical for all related items) which works for the dataset
> related item pages but not for the /app url.

Dataset id vs package id? Was one of these meant to be related item id?

> 2) agree to fix this issue which would need the following
> 
> a) add a dataset field to the related table that links back to the
> dataset that has the item (an populate it)
> b) change the logic functions to update this field
> c) use this field in the related snippets for correct results

So you're saying that when a related item does belong to a dataset, some
of the action and auth functions need the dataset id in order to e.g.
decide if a user is allowed to delete the related item?

If that's the case, I think adding a column of dataset IDs to the
related table seems like a good idea. But it should be allowed to have
NULL in this column, and all the action, auth and snippets should be
aware of this.




More information about the ckan-dev mailing list