[ckan-dev] Question about the ID assigned to tables of the datastore

Ian Ward ian at excess.org
Sat Apr 27 13:27:23 UTC 2013


On Sat, Apr 27, 2013 at 4:16 AM, 天龙出云 <dragoniszhang at gmail.com> wrote:
> I want to know how CKAN generates an ID to be the name of a table in
> datastore db when creating a dataset through uploading a csv/xml file.(Is
> the ID generated by sqlalchemy?)
> Thank you very much.

Hello 天龙出云,

Yes, it looks like the resource IDs are set by sqlalchemy's field
default parameter in the model definition here:
  https://github.com/okfn/ckan/blob/master/ckan/model/resource.py#L37

Ian




More information about the ckan-dev mailing list