# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models import ModelName". # Use orm.ModelName to refer to models in this application, # and orm['appname.ModelName'] for models in other applications. for update in orm.RaceUpdate.objects.all(): update.race = update.racer.race update.save() def backwards(self, orm): "Write your backwards methods here." models = { u'races.race': { 'Meta': {'object_name': 'Race'}, 'description': ('django.db.models.fields.TextField', [], {}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '16', 'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}) }, u'races.racer': { 'Meta': {'unique_together': "(('nick', 'race'),)", 'object_name': 'Racer'}, 'finished': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'joined': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'nick': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'race': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['races.Race']"}), 'started': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) }, u'races.raceupdate': { 'Meta': {'object_name': 'RaceUpdate'}, 'event_time': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'race': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['races.Race']"}), 'racer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['races.Racer']"}), 'update': ('django.db.models.fields.TextField', [], {}) } } complete_apps = ['races'] symmetrical = True