j2labs/brubeck — pull request #69 by stuntgoat (2012-05-15 17:06:56+00:00)
Title: RedisQueryset

Passing tests. There are notes in the comments. I want to make sure I am returning the correct value from each call under every circumstance. For instance `RedisQueryset.update_one(_shield_)` returns either MSG_UPDATED or MSG_CREATED; I'm not sure if this is correct, it's the default while using Redis' HSET command. Another option would be to check existence of the key; if it did not exist, return a some other status and don't create a new object. Just an idea- I'm don't know the philosophy or the specification behind your REST interface. The other method I have a question about is `destroy` methods: if `destroy_one` fails to find a key in the database it returns a FourOhFourException but `destroy_many` returns a MSG_FAILED in each instance looks up a missing key.

Also, in the tests: `create_one` test case fails because it is expecting a MSG_CREATED but the value is MSG_UPDATED because at that point in the test the object being created already exists. Would an easy fix be to create a new object in `create_one` that is not being created in any other test or for instance in `seed_reads`. It looks like the tests are not executed in order so some object is being left behind in the database and when `create_one` is executed, the object is there so RedisQueryset returns MSG_UPDATED. My terrible hack is to first delete the hash that contains the key `foo` within `create_one`.