Skip to content

Instantly share code, notes, and snippets.

@MariuszWisniewski
Last active May 19, 2016 14:27
Show Gist options
  • Save MariuszWisniewski/e5dee79a2a85b92eea25b54051344a7e to your computer and use it in GitHub Desktop.
Save MariuszWisniewski/e5dee79a2a85b92eea25b54051344a7e to your computer and use it in GitHub Desktop.
import syncano
from syncano.models import User
from syncano.models import Object
syncano.connect(api_key='ACCOUNT_KEY', instance_name=META['instance'])
user_id = ARGS['owner']
user_profile_id = ARGS['id']
user = User.please.get(
id=user_id
)
print "Adding username and read permissions for user {user}".format(user=user.username)
Object.please.update(
id=user_profile_id,
class_name='user_profile',
other_permissions='read',
username=user.username #optional - for this to work, user_profile must have a `username` of type String column
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment