Skip to content

Instantly share code, notes, and snippets.

@devintyler
Created June 24, 2016 20:53
Show Gist options
  • Save devintyler/4a433dc76899ec8bbc73b0f63f1a0a34 to your computer and use it in GitHub Desktop.
Save devintyler/4a433dc76899ec8bbc73b0f63f1a0a34 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'])
def add_username_to_user(user):
print user.id
user_profile = Object.please.list(
class_name='user_profile'
).filter(owner__eq=user.id).first()
print user_profile
Object.please.update(
id=user_profile.id,
class_name='user_profile',
other_permissions='read',
username=user.username
)
users = User.please.list()
for user in users:
print "Adding username and read permissions for user {user}".format(user=user.username)
add_username_to_user(user)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment