'Used to generate random key/secret pairings. Use this after you\'ve
added the other data in place of save().
c = Consumer()
c.name = "My consumer"
c.description = "An app that makes ponies from the API."
c.user = some_user_object
c.generate_random_codes()'

def generate_random_codes(self):

    key = User.objects.make_random_password(length=KEY_SIZE)
    secret = generate_random(SECRET_SIZE)
    while Consumer.objects.filter(key__exact=key, secret__exact=secret).count():
        secret = generate_random(SECRET_SIZE)
    self.key = key
    self.secret = secret
    self.save()
