'Shortcut to create a token with random key/secret.'

def create_token(self, consumer_id, token_type, timestamp, user=None, using=None):

    if using:
        manager = self.using(using)
    else:
        manager = self
    (token, created) = manager.get_or_create(consumer_id=consumer_id, token_type=token_type, timestamp=timestamp, user=user)
    if created:
        (token.key, token.secret) = self.generate_random_codes()
        token.save()
    return token
