{"action":"opened","issue":{"url":"https://api.github.com/repos/croach/Flask-Fixtures/issues/17","labels_url":"https://api.github.com/repos/croach/Flask-Fixtures/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/croach/Flask-Fixtures/issues/17/comments","events_url":"https://api.github.com/repos/croach/Flask-Fixtures/issues/17/events","html_url":"https://github.com/croach/Flask-Fixtures/issues/17","id":109887109,"number":17,"title":"Possible issue with bit fields","user":{"login":"jkugler","id":78939,"avatar_url":"https://avatars.githubusercontent.com/u/78939?v=3","gravatar_id":"","url":"https://api.github.com/users/jkugler","html_url":"https://github.com/jkugler","followers_url":"https://api.github.com/users/jkugler/followers","following_url":"https://api.github.com/users/jkugler/following{/other_user}","gists_url":"https://api.github.com/users/jkugler/gists{/gist_id}","starred_url":"https://api.github.com/users/jkugler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkugler/subscriptions","organizations_url":"https://api.github.com/users/jkugler/orgs","repos_url":"https://api.github.com/users/jkugler/repos","events_url":"https://api.github.com/users/jkugler/events{/privacy}","received_events_url":"https://api.github.com/users/jkugler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-05T21:11:08Z","updated_at":"2015-10-05T21:11:08Z","closed_at":null,"body":"This may be an issue with me not understanding fixtures and/or SQLAlchemy, but any assistance would be great!\r\n\r\nI have some data dumped from an MS SQL DB, which is using BIT fields for true/false.  I'm trying to load it into a PostgreSQL DB for testing.  The data is exported by getting the records (via SQLAlchemy), and then looping over them and generating each dict thus:\r\n```\r\ndef as_dict(r):\r\n    d = {}\r\n\r\n    for c in r.__table__.columns:\r\n        o = getattr(r, c.name)\r\n        d[c.name]= o\r\n\r\n    return d\r\n```\r\nThat works great, properly formats UUIDs and date/times.  However, the bit fields come out as 'true' or 'false.'  While that is what they are being used as, this then creates issues later.  When I try to load them into the PG DB (again, via Flask-Fixtures), I get an exception of:\r\n```\r\nsqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) column \"isActive\" is of type bit but expression is of type boolean\r\n```\r\nIf I change the true/false entries to 1/0 in the Yaml file, I then get:\r\n```\r\nsqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) column \"isActive\" is of type bit but expression is of type integer\r\n```\r\nIs there a way to mark them such that Flask-Fixtures will turn them back into Bit objects before it tries to insert them? Does Flask-Fixtures introspect on the column\r\n\r\nI realize the proper answer here is \"convert them to boolean fields,\" but this is a legacy database, and quick-and-dirty changes to the schema would not happen soon. :)\r\n\r\nThis may well be an issue with SQLAlchemy, as it seems it converts from the bit field to a true/false value when selecting, but then does not convert back when inserting the value.\r\n\r\nHow *DO* you pass a bit object to SQLAlchemy?"}}