# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models

class Migration(DataMigration):
    
    def __init__(self):
        self.suUsername = "sue"
        self.suPassword = "mypass"
        self.suEmail = "hgezim@gmail.com"
        self.suFirstName = "Super"
        self.suLastName = "User"
        self.suPhone = "403 359 2801"

    def forwards(self, orm):
        """Create superuser account with profile."""
        
        location_type = orm['mooi.Location']
        if len(location_type.objects.all()) == 0:
            l = location_type(city="Lethbridge", country="Canada")
            l.save()
        else:
            l = location_type.objects.all()[0]
            
        
        user_type = orm['auth.User']
        user = user_type(username=self.suUsername, email=self.suEmail, password=self.suPassword)
        user.first_name = self.suFirstName
        user.last_name = self.suLastName
        user.is_superuser = True
        user.save()
        
        profile_type = orm['mooi.Profile']
        userProfile = profile_type(user=user, location=l, phone=self.suPhone)
        userProfile.location = l
        userProfile.phone = self.suPhone
        userProfile.save()

    def backwards(self, orm):
        """Remove superuser account and profile."""
        
        user_type = orm['auth.User']
        user = user_type.objects.get(username=self.suUsername)
        
        profile_type = orm['mooi.Profile']
        userProfile = profile_type.objects.get(user=user)
        
        userProfile.delete()
        user.delete()
        

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'mooi.author': {
            'Meta': {'object_name': 'Author'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'mooi.book': {
            'ISBN': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'Meta': {'object_name': 'Book'},
            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['mooi.Author']", 'symmetrical': 'False'}),
            'discipline': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'edition': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'picture': ('django.db.models.fields.FilePathField', [], {'path': "'/home/haxhia/book_images'", 'max_length': '100', 'blank': 'True'}),
            'published_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'publisher': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '400'})
        },
        'mooi.book_copy': {
            'Meta': {'object_name': 'Book_Copy'},
            'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mooi.Book']"}),
            'condition': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '2', 'decimal_places': '1'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
            'price': ('django.db.models.fields.FloatField', [], {}),
            'sold': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'sponsored': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})
        },
        'mooi.location': {
            'Meta': {'object_name': 'Location'},
            'city': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'country': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        },
        'mooi.profile': {
            'Meta': {'object_name': 'Profile'},
            'credits': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mooi.Location']", 'null': 'True'}),
            'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'transaction_status': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
        },
        'mooi.user': {
            'Meta': {'object_name': 'User'},
            'credits': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '100', 'blank': 'True'}),
            'id': ('django.db.models.fields.CharField', [], {'max_length': '100', 'primary_key': 'True'}),
            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mooi.Location']"}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'transaction_status': ('django.db.models.fields.CharField', [], {'max_length': '20'})
        }
    }

    complete_apps = ['mooi']

9e24abb3fe4fafa6cd339ccc940b4c3118103110
<mask token>


class Migration(DataMigration):
    <mask token>
    <mask token>

    def backwards(self, orm):
        """Remove superuser account and profile."""
        user_type = orm['auth.User']
        user = user_type.objects.get(username=self.suUsername)
        profile_type = orm['mooi.Profile']
        userProfile = profile_type.objects.get(user=user)
        userProfile.delete()
        user.delete()
    <mask token>
    <mask token>

<mask token>


class Migration(DataMigration):

    def __init__(self):
        self.suUsername = 'sue'
        self.suPassword = 'mypass'
        self.suEmail = 'hgezim@gmail.com'
        self.suFirstName = 'Super'
        self.suLastName = 'User'
        self.suPhone = '403 359 2801'
    <mask token>

    def backwards(self, orm):
        """Remove superuser account and profile."""
        user_type = orm['auth.User']
        user = user_type.objects.get(username=self.suUsername)
        profile_type = orm['mooi.Profile']
        userProfile = profile_type.objects.get(user=user)
        userProfile.delete()
        user.delete()
    <mask token>
    <mask token>

<mask token>


class Migration(DataMigration):

    def __init__(self):
        self.suUsername = 'sue'
        self.suPassword = 'mypass'
        self.suEmail = 'hgezim@gmail.com'
        self.suFirstName = 'Super'
        self.suLastName = 'User'
        self.suPhone = '403 359 2801'

    def forwards(self, orm):
        """Create superuser account with profile."""
        location_type = orm['mooi.Location']
        if len(location_type.objects.all()) == 0:
            l = location_type(city='Lethbridge', country='Canada')
            l.save()
        else:
            l = location_type.objects.all()[0]
        user_type = orm['auth.User']
        user = user_type(username=self.suUsername, email=self.suEmail,
            password=self.suPassword)
        user.first_name = self.suFirstName
        user.last_name = self.suLastName
        user.is_superuser = True
        user.save()
        profile_type = orm['mooi.Profile']
        userProfile = profile_type(user=user, location=l, phone=self.suPhone)
        userProfile.location = l
        userProfile.phone = self.suPhone
        userProfile.save()

    def backwards(self, orm):
        """Remove superuser account and profile."""
        user_type = orm['auth.User']
        user = user_type.objects.get(username=self.suUsername)
        profile_type = orm['mooi.Profile']
        userProfile = profile_type.objects.get(user=user)
        userProfile.delete()
        user.delete()
    models = {'auth.group': {'Meta': {'object_name': 'Group'}, 'id': (
        'django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
        'name': ('django.db.models.fields.CharField', [], {'unique': 'True',
        'max_length': '80'}), 'permissions': (
        'django.db.models.fields.related.ManyToManyField', [], {'to':
        "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        }, 'auth.permission': {'Meta': {'unique_together':
        "(('content_type', 'codename'),)", 'object_name': 'Permission'},
        'codename': ('django.db.models.fields.CharField', [], {'max_length':
        '100'}), 'content_type': (
        'django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['contenttypes.ContentType']"}), 'id': (
        'django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
        'name': ('django.db.models.fields.CharField', [], {'max_length':
        '50'})}, 'auth.user': {'Meta': {'object_name': 'User'},
        'date_joined': ('django.db.models.fields.DateTimeField', [], {
        'default': 'datetime.datetime.now'}), 'email': (
        'django.db.models.fields.EmailField', [], {'max_length': '75',
        'blank': 'True'}), 'first_name': (
        'django.db.models.fields.CharField', [], {'max_length': '30',
        'blank': 'True'}), 'groups': (
        'django.db.models.fields.related.ManyToManyField', [], {'to':
        "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
        'id': ('django.db.models.fields.AutoField', [], {'primary_key':
        'True'}), 'is_active': ('django.db.models.fields.BooleanField', [],
        {'default': 'True', 'blank': 'True'}), 'is_staff': (
        'django.db.models.fields.BooleanField', [], {'default': 'False',
        'blank': 'True'}), 'is_superuser': (
        'django.db.models.fields.BooleanField', [], {'default': 'False',
        'blank': 'True'}), 'last_login': (
        'django.db.models.fields.DateTimeField', [], {'default':
        'datetime.datetime.now'}), 'last_name': (
        'django.db.models.fields.CharField', [], {'max_length': '30',
        'blank': 'True'}), 'password': ('django.db.models.fields.CharField',
        [], {'max_length': '128'}), 'user_permissions': (
        'django.db.models.fields.related.ManyToManyField', [], {'to':
        "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
        'username': ('django.db.models.fields.CharField', [], {'unique':
        'True', 'max_length': '30'})}, 'contenttypes.contenttype': {'Meta':
        {'unique_together': "(('app_label', 'model'),)", 'object_name':
        'ContentType', 'db_table': "'django_content_type'"}, 'app_label': (
        'django.db.models.fields.CharField', [], {'max_length': '100'}),
        'id': ('django.db.models.fields.AutoField', [], {'primary_key':
        'True'}), 'model': ('django.db.models.fields.CharField', [], {
        'max_length': '100'}), 'name': ('django.db.models.fields.CharField',
        [], {'max_length': '100'})}, 'mooi.author': {'Meta': {'object_name':
        'Author'}, 'id': ('django.db.models.fields.AutoField', [], {
        'primary_key': 'True'}), 'name': (
        'django.db.models.fields.CharField', [], {'max_length': '100'})},
        'mooi.book': {'ISBN': ('django.db.models.fields.CharField', [], {
        'max_length': '20', 'blank': 'True'}), 'Meta': {'object_name':
        'Book'}, 'authors': (
        'django.db.models.fields.related.ManyToManyField', [], {'to':
        "orm['mooi.Author']", 'symmetrical': 'False'}), 'discipline': (
        'django.db.models.fields.CharField', [], {'max_length': '50',
        'blank': 'True'}), 'edition': ('django.db.models.fields.CharField',
        [], {'max_length': '50', 'blank': 'True'}), 'id': (
        'django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
        'picture': ('django.db.models.fields.FilePathField', [], {'path':
        "'/home/haxhia/book_images'", 'max_length': '100', 'blank': 'True'}
        ), 'published_date': ('django.db.models.fields.DateField', [], {
        'null': 'True', 'blank': 'True'}), 'publisher': (
        'django.db.models.fields.CharField', [], {'max_length': '100',
        'blank': 'True'}), 'title': ('django.db.models.fields.CharField', [
        ], {'max_length': '400'})}, 'mooi.book_copy': {'Meta': {
        'object_name': 'Book_Copy'}, 'book': (
        'django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['mooi.Book']"}), 'condition': (
        'django.db.models.fields.DecimalField', [], {'null': 'True',
        'max_digits': '2', 'decimal_places': '1'}), 'id': (
        'django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
        'owner': ('django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['auth.User']"}), 'price': (
        'django.db.models.fields.FloatField', [], {}), 'sold': (
        'django.db.models.fields.BooleanField', [], {'default': 'False',
        'blank': 'True'}), 'sponsored': (
        'django.db.models.fields.BooleanField', [], {'default': 'False',
        'blank': 'True'})}, 'mooi.location': {'Meta': {'object_name':
        'Location'}, 'city': ('django.db.models.fields.CharField', [], {
        'max_length': '50'}), 'country': (
        'django.db.models.fields.CharField', [], {'max_length': '50'}),
        'id': ('django.db.models.fields.AutoField', [], {'primary_key':
        'True'})}, 'mooi.profile': {'Meta': {'object_name': 'Profile'},
        'credits': ('django.db.models.fields.IntegerField', [], {'default':
        '1'}), 'id': ('django.db.models.fields.AutoField', [], {
        'primary_key': 'True'}), 'location': (
        'django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['mooi.Location']", 'null': 'True'}), 'phone': (
        'django.db.models.fields.CharField', [], {'max_length': '20',
        'blank': 'True'}), 'transaction_status': (
        'django.db.models.fields.CharField', [], {'max_length': '20',
        'blank': 'True'}), 'user': (
        'django.db.models.fields.related.OneToOneField', [], {'to':
        "orm['auth.User']", 'unique': 'True'})}, 'mooi.user': {'Meta': {
        'object_name': 'User'}, 'credits': (
        'django.db.models.fields.IntegerField', [], {'default': '1'}),
        'email': ('django.db.models.fields.EmailField', [], {'max_length':
        '100', 'blank': 'True'}), 'id': (
        'django.db.models.fields.CharField', [], {'max_length': '100',
        'primary_key': 'True'}), 'location': (
        'django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['mooi.Location']"}), 'name': (
        'django.db.models.fields.CharField', [], {'max_length': '100'}),
        'password': ('django.db.models.fields.CharField', [], {'max_length':
        '50'}), 'phone': ('django.db.models.fields.CharField', [], {
        'max_length': '20', 'blank': 'True'}), 'transaction_status': (
        'django.db.models.fields.CharField', [], {'max_length': '20'})}}
    complete_apps = ['mooi']

import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models


class Migration(DataMigration):

    def __init__(self):
        self.suUsername = 'sue'
        self.suPassword = 'mypass'
        self.suEmail = 'hgezim@gmail.com'
        self.suFirstName = 'Super'
        self.suLastName = 'User'
        self.suPhone = '403 359 2801'

    def forwards(self, orm):
        """Create superuser account with profile."""
        location_type = orm['mooi.Location']
        if len(location_type.objects.all()) == 0:
            l = location_type(city='Lethbridge', country='Canada')
            l.save()
        else:
            l = location_type.objects.all()[0]
        user_type = orm['auth.User']
        user = user_type(username=self.suUsername, email=self.suEmail,
            password=self.suPassword)
        user.first_name = self.suFirstName
        user.last_name = self.suLastName
        user.is_superuser = True
        user.save()
        profile_type = orm['mooi.Profile']
        userProfile = profile_type(user=user, location=l, phone=self.suPhone)
        userProfile.location = l
        userProfile.phone = self.suPhone
        userProfile.save()

    def backwards(self, orm):
        """Remove superuser account and profile."""
        user_type = orm['auth.User']
        user = user_type.objects.get(username=self.suUsername)
        profile_type = orm['mooi.Profile']
        userProfile = profile_type.objects.get(user=user)
        userProfile.delete()
        user.delete()
    models = {'auth.group': {'Meta': {'object_name': 'Group'}, 'id': (
        'django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
        'name': ('django.db.models.fields.CharField', [], {'unique': 'True',
        'max_length': '80'}), 'permissions': (
        'django.db.models.fields.related.ManyToManyField', [], {'to':
        "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        }, 'auth.permission': {'Meta': {'unique_together':
        "(('content_type', 'codename'),)", 'object_name': 'Permission'},
        'codename': ('django.db.models.fields.CharField', [], {'max_length':
        '100'}), 'content_type': (
        'django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['contenttypes.ContentType']"}), 'id': (
        'django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
        'name': ('django.db.models.fields.CharField', [], {'max_length':
        '50'})}, 'auth.user': {'Meta': {'object_name': 'User'},
        'date_joined': ('django.db.models.fields.DateTimeField', [], {
        'default': 'datetime.datetime.now'}), 'email': (
        'django.db.models.fields.EmailField', [], {'max_length': '75',
        'blank': 'True'}), 'first_name': (
        'django.db.models.fields.CharField', [], {'max_length': '30',
        'blank': 'True'}), 'groups': (
        'django.db.models.fields.related.ManyToManyField', [], {'to':
        "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
        'id': ('django.db.models.fields.AutoField', [], {'primary_key':
        'True'}), 'is_active': ('django.db.models.fields.BooleanField', [],
        {'default': 'True', 'blank': 'True'}), 'is_staff': (
        'django.db.models.fields.BooleanField', [], {'default': 'False',
        'blank': 'True'}), 'is_superuser': (
        'django.db.models.fields.BooleanField', [], {'default': 'False',
        'blank': 'True'}), 'last_login': (
        'django.db.models.fields.DateTimeField', [], {'default':
        'datetime.datetime.now'}), 'last_name': (
        'django.db.models.fields.CharField', [], {'max_length': '30',
        'blank': 'True'}), 'password': ('django.db.models.fields.CharField',
        [], {'max_length': '128'}), 'user_permissions': (
        'django.db.models.fields.related.ManyToManyField', [], {'to':
        "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
        'username': ('django.db.models.fields.CharField', [], {'unique':
        'True', 'max_length': '30'})}, 'contenttypes.contenttype': {'Meta':
        {'unique_together': "(('app_label', 'model'),)", 'object_name':
        'ContentType', 'db_table': "'django_content_type'"}, 'app_label': (
        'django.db.models.fields.CharField', [], {'max_length': '100'}),
        'id': ('django.db.models.fields.AutoField', [], {'primary_key':
        'True'}), 'model': ('django.db.models.fields.CharField', [], {
        'max_length': '100'}), 'name': ('django.db.models.fields.CharField',
        [], {'max_length': '100'})}, 'mooi.author': {'Meta': {'object_name':
        'Author'}, 'id': ('django.db.models.fields.AutoField', [], {
        'primary_key': 'True'}), 'name': (
        'django.db.models.fields.CharField', [], {'max_length': '100'})},
        'mooi.book': {'ISBN': ('django.db.models.fields.CharField', [], {
        'max_length': '20', 'blank': 'True'}), 'Meta': {'object_name':
        'Book'}, 'authors': (
        'django.db.models.fields.related.ManyToManyField', [], {'to':
        "orm['mooi.Author']", 'symmetrical': 'False'}), 'discipline': (
        'django.db.models.fields.CharField', [], {'max_length': '50',
        'blank': 'True'}), 'edition': ('django.db.models.fields.CharField',
        [], {'max_length': '50', 'blank': 'True'}), 'id': (
        'django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
        'picture': ('django.db.models.fields.FilePathField', [], {'path':
        "'/home/haxhia/book_images'", 'max_length': '100', 'blank': 'True'}
        ), 'published_date': ('django.db.models.fields.DateField', [], {
        'null': 'True', 'blank': 'True'}), 'publisher': (
        'django.db.models.fields.CharField', [], {'max_length': '100',
        'blank': 'True'}), 'title': ('django.db.models.fields.CharField', [
        ], {'max_length': '400'})}, 'mooi.book_copy': {'Meta': {
        'object_name': 'Book_Copy'}, 'book': (
        'django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['mooi.Book']"}), 'condition': (
        'django.db.models.fields.DecimalField', [], {'null': 'True',
        'max_digits': '2', 'decimal_places': '1'}), 'id': (
        'django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
        'owner': ('django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['auth.User']"}), 'price': (
        'django.db.models.fields.FloatField', [], {}), 'sold': (
        'django.db.models.fields.BooleanField', [], {'default': 'False',
        'blank': 'True'}), 'sponsored': (
        'django.db.models.fields.BooleanField', [], {'default': 'False',
        'blank': 'True'})}, 'mooi.location': {'Meta': {'object_name':
        'Location'}, 'city': ('django.db.models.fields.CharField', [], {
        'max_length': '50'}), 'country': (
        'django.db.models.fields.CharField', [], {'max_length': '50'}),
        'id': ('django.db.models.fields.AutoField', [], {'primary_key':
        'True'})}, 'mooi.profile': {'Meta': {'object_name': 'Profile'},
        'credits': ('django.db.models.fields.IntegerField', [], {'default':
        '1'}), 'id': ('django.db.models.fields.AutoField', [], {
        'primary_key': 'True'}), 'location': (
        'django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['mooi.Location']", 'null': 'True'}), 'phone': (
        'django.db.models.fields.CharField', [], {'max_length': '20',
        'blank': 'True'}), 'transaction_status': (
        'django.db.models.fields.CharField', [], {'max_length': '20',
        'blank': 'True'}), 'user': (
        'django.db.models.fields.related.OneToOneField', [], {'to':
        "orm['auth.User']", 'unique': 'True'})}, 'mooi.user': {'Meta': {
        'object_name': 'User'}, 'credits': (
        'django.db.models.fields.IntegerField', [], {'default': '1'}),
        'email': ('django.db.models.fields.EmailField', [], {'max_length':
        '100', 'blank': 'True'}), 'id': (
        'django.db.models.fields.CharField', [], {'max_length': '100',
        'primary_key': 'True'}), 'location': (
        'django.db.models.fields.related.ForeignKey', [], {'to':
        "orm['mooi.Location']"}), 'name': (
        'django.db.models.fields.CharField', [], {'max_length': '100'}),
        'password': ('django.db.models.fields.CharField', [], {'max_length':
        '50'}), 'phone': ('django.db.models.fields.CharField', [], {
        'max_length': '20', 'blank': 'True'}), 'transaction_status': (
        'django.db.models.fields.CharField', [], {'max_length': '20'})}}
    complete_apps = ['mooi']

# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models

class Migration(DataMigration):
    
    def __init__(self):
        self.suUsername = "sue"
        self.suPassword = "mypass"
        self.suEmail = "hgezim@gmail.com"
        self.suFirstName = "Super"
        self.suLastName = "User"
        self.suPhone = "403 359 2801"

    def forwards(self, orm):
        """Create superuser account with profile."""
        
        location_type = orm['mooi.Location']
        if len(location_type.objects.all()) == 0:
            l = location_type(city="Lethbridge", country="Canada")
            l.save()
        else:
            l = location_type.objects.all()[0]
            
        
        user_type = orm['auth.User']
        user = user_type(username=self.suUsername, email=self.suEmail, password=self.suPassword)
        user.first_name = self.suFirstName
        user.last_name = self.suLastName
        user.is_superuser = True
        user.save()
        
        profile_type = orm['mooi.Profile']
        userProfile = profile_type(user=user, location=l, phone=self.suPhone)
        userProfile.location = l
        userProfile.phone = self.suPhone
        userProfile.save()

    def backwards(self, orm):
        """Remove superuser account and profile."""
        
        user_type = orm['auth.User']
        user = user_type.objects.get(username=self.suUsername)
        
        profile_type = orm['mooi.Profile']
        userProfile = profile_type.objects.get(user=user)
        
        userProfile.delete()
        user.delete()
        

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'mooi.author': {
            'Meta': {'object_name': 'Author'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'mooi.book': {
            'ISBN': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'Meta': {'object_name': 'Book'},
            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['mooi.Author']", 'symmetrical': 'False'}),
            'discipline': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'edition': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'picture': ('django.db.models.fields.FilePathField', [], {'path': "'/home/haxhia/book_images'", 'max_length': '100', 'blank': 'True'}),
            'published_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'publisher': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '400'})
        },
        'mooi.book_copy': {
            'Meta': {'object_name': 'Book_Copy'},
            'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mooi.Book']"}),
            'condition': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '2', 'decimal_places': '1'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
            'price': ('django.db.models.fields.FloatField', [], {}),
            'sold': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
            'sponsored': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})
        },
        'mooi.location': {
            'Meta': {'object_name': 'Location'},
            'city': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'country': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        },
        'mooi.profile': {
            'Meta': {'object_name': 'Profile'},
            'credits': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mooi.Location']", 'null': 'True'}),
            'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'transaction_status': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
        },
        'mooi.user': {
            'Meta': {'object_name': 'User'},
            'credits': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '100', 'blank': 'True'}),
            'id': ('django.db.models.fields.CharField', [], {'max_length': '100', 'primary_key': 'True'}),
            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mooi.Location']"}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
            'transaction_status': ('django.db.models.fields.CharField', [], {'max_length': '20'})
        }
    }

    complete_apps = ['mooi']
