{"action":"opened","issue":{"url":"https://api.github.com/repos/potatolondon/djangae/issues/332","labels_url":"https://api.github.com/repos/potatolondon/djangae/issues/332/labels{/name}","comments_url":"https://api.github.com/repos/potatolondon/djangae/issues/332/comments","events_url":"https://api.github.com/repos/potatolondon/djangae/issues/332/events","html_url":"https://github.com/potatolondon/djangae/issues/332","id":76396404,"number":332,"title":"ShardedCounterField improvements","user":{"login":"adamalton","id":270255,"avatar_url":"https://avatars.githubusercontent.com/u/270255?v=3","gravatar_id":"","url":"https://api.github.com/users/adamalton","html_url":"https://github.com/adamalton","followers_url":"https://api.github.com/users/adamalton/followers","following_url":"https://api.github.com/users/adamalton/following{/other_user}","gists_url":"https://api.github.com/users/adamalton/gists{/gist_id}","starred_url":"https://api.github.com/users/adamalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamalton/subscriptions","organizations_url":"https://api.github.com/users/adamalton/orgs","repos_url":"https://api.github.com/users/adamalton/repos","events_url":"https://api.github.com/users/adamalton/events{/privacy}","received_events_url":"https://api.github.com/users/adamalton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-14T15:33:30Z","updated_at":"2015-05-14T15:33:30Z","closed_at":null,"body":"There are a few issues / things that I think we should improve on this:\r\n\r\nIssues:\r\n\r\n* Currently, by default, if you have `my_field = ShardedCounterField()` on a model, then in the Django admin the field is shown as a required text input, but the values in the field are the PKs of the `CounterShard` objects, so putting a value in there is pointless.  Possible fixes:\r\n  * In `ShardedCounterField.__init__` set `editable=False` by default.\r\n  * In `ShardedCounterField.__init__` set `blank=True` by default.  This would allow you to see the PKs of the `CounterShard` objects in the admin, although it would (dangerously) allow you to edit them.\r\n\r\nImprovements:\r\n\r\n* In `ShardedCounterField.pre_save` we create the `CounterShard` objects in a loop.  It seems that it would be better to do a bulk creation of these, rather than causing separate `Put` operations.\r\n* Perhaps the whole thing should subclass `RelatedSetField`.  It should at the least subclass `SetField` and not `ListField`."}}