[openspending-dev] adding foreign keys for imported datasets

Friedrich Lindenberg friedrich.lindenberg at okfn.org
Tue Jan 31 14:54:38 UTC 2012

Hey Telmo!

welcome to the project! Thanks for the changeset, thats pretty cool.
I'm wondering if you could but it on a branch and make a pull request
against OpenSpending where we can discuss it?

Off the top of my head I'm wondering whether we shouldn't use
SQLAlchemy's built-in FK support [1], since that is guaranteed to work
across different backends?

Also I'd be interested if this has any implications on how we can drop
a dataset or if that resolution is handled automatically by


- Friedrich

[1] http://docs.sqlalchemy.org/en/latest/core/schema.html#sqlalchemy.schema.ForeignKey

On Tue, Jan 31, 2012 at 3:36 PM, Telmo Brugnara <tbrugz at gmail.com> wrote:
> Hi there,
> I've added some changes to a github openspending fork [1]. These
> changes basically add foreign keys for the imported star schema, i.e.,
> from "<dataset>_entry" to each CompoundDimension. The changes do not
> add any noticeable functionality, they only make the model more
> understandable when you reverse engineer it (and, yes, add referential
> integrity)
> Changes are in [2]. I've tested on a simple model with some
> CompoundDimensions and it worked fine. Since I'm new in the list, I
> dont know if I should open an issue on github or make a pull request
> (for a new branch?)...
> Telmo
> --
> [1] https://github.com/tbrugz/openspending
> [2] https://github.com/tbrugz/openspending/tree/feature/model+fk
> _______________________________________________
> openspending-dev mailing list
> openspending-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/openspending-dev

More information about the openspending-dev mailing list