Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- from south.db import db
- from south.v2 import DataMigration
- from django.contrib.auth.models import User
- class Migration(DataMigration):
- depends_on = (
- ('zinbox', '0014_add_ct_access_permissions_to_users'),
- )
- def forwards(self, orm):
- for user in User.objects.all():
- user = User.objects.filter(email__endswith='@nsn.com')
- orm['auth.User'].email = orm.User.email.split('@')[0] + '@nokia.com'
- orm['auth.User'].save()
- def backwards(self, orm):
- raise RuntimeError('Cannot reverse this migration')
- models = {
- 'auth.user': {
- 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
- },
- }
- complete_apps = ['zinbox']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement