Skip to content

Instantly share code, notes, and snippets.

@Tombar
Last active December 18, 2015 13:29
Show Gist options
  • Save Tombar/5789897 to your computer and use it in GitHub Desktop.
Save Tombar/5789897 to your computer and use it in GitHub Desktop.
# on the db
mysql> select id, display_name, email, lower(concat(replace(display_name, ' ', ''), id)) as clave_nueva from UserData_userprofile;
| 189 | Moe | | moe189 |
| 190 | Larry | | larry190 |
| 191 | Curly | | curly191 |
# on the admin
http://{site}/admin/auth/user/191/ is Moe
http://{site}/admin/auth/user/192/ is Larry
http://{site}/admin/auth/user/193/ is Curly
# on mange.py shell
>>> from django.contrib.auth.models import User
>>> for user in User.objects.all():
... user.id
... user.username
...
u'Moe'
192L
u'Larry'
193L
u'Curly'
194L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment