Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. from django.db import models
  2. from south.db import db
  3. from south.v2 import DataMigration
  4. from django.contrib.auth.models import User
  5.  
  6. class Migration(DataMigration):
  7. depends_on = (
  8. ('zinbox', '0014_add_ct_access_permissions_to_users'),
  9. )
  10.  
  11. def forwards(self, orm):
  12.  
  13. for user in User.objects.all():
  14. user = User.objects.filter(email__endswith='@nsn.com')
  15. orm['auth.User'].email = orm.User.email.split('@')[0] + '@nokia.com'
  16. orm['auth.User'].save()
  17.  
  18. def backwards(self, orm):
  19. raise RuntimeError('Cannot reverse this migration')
  20.  
  21.  
  22. models = {
  23. 'auth.user': {
  24. 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
  25. },
  26.  
  27. }
  28.  
  29. complete_apps = ['zinbox']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement