{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/6d7d4aa2b3f1602705b599cdd5dc72bd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"6d7d4aa2b3f1602705b599cdd5dc72bd","url":"https://api.github.com/users/pudo","login":"pudo","id":41628},"milestone":null,"labels":[],"assignee":{"avatar_url":"https://secure.gravatar.com/avatar/6d7d4aa2b3f1602705b599cdd5dc72bd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"6d7d4aa2b3f1602705b599cdd5dc72bd","url":"https://api.github.com/users/pudo","login":"pudo","id":41628},"updated_at":"2011-11-11T11:14:10Z","comments":4,"closed_at":null,"url":"https://api.github.com/repos/okfn/openspending/issues/289","body":"The model validation code is currently using Colander for validation. This works for the most part but model validation has a lot of very specific business rules that we should validate. Since hardly any of them match the kind of validation Colander does it may make sense to just use a linear, procedural style of validation and not to do try to wrestle this into colander. Putting it in is probably possible, but I get the feeling its less readable.\r\n\r\nSome rules:\r\n\r\n* A dimension named \"time\" must exist, it must be \"date\"\r\n* A dimension named \"amount\" must exist, it must be \"measure\"\r\n* A dimension or measure may not be called \"id\" or contain \"__\" or any in a list of forbidden words.\r\n* If a compound dimension named \"foo\" exists, there may not be an attribute dimension named \"foo_id\" (FK conflict)\r\n* Compound dimensions may not have an attribute \"id\"\r\n* Compound dimensions must have an attribute \"name\" of datatype \"id\"\r\n* If a compound dimension has an attribute \"color\", it must be \"string\"\r\n* If a compound dimension has an attribute \"parent\", it must be \"id\"\r\n","html_url":"https://github.com/okfn/openspending/issues/289","number":289,"title":"Refactor model validator to procedural validation","id":2207329,"created_at":"2011-11-11T08:27:18Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/ced0f596d028d6db75def019cf93c108?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"ced0f596d028d6db75def019cf93c108","url":"https://api.github.com/users/mk270","login":"mk270","id":923403},"updated_at":"2011-11-11T11:14:10Z","url":"https://api.github.com/repos/okfn/openspending/issues/comments/2707086","body":"The rules need to be in a separate authoritative document, initially this ticket, and ultimately in the docs","id":2707086,"created_at":"2011-11-11T11:14:10Z"}}