# Path: ssheepdog/utils.py
# def add_permission(orm, codename, name, app_label='ssheepdog', model='login'):
#     ct, created = orm['contenttypes.ContentType'].objects.get_or_create(
#         model=model, app_label=app_label)
#     orm['auth.permission'].objects.get_or_create(
#         content_type=ct, codename=codename, defaults=dict(name=name))


import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from ssheepdog.utils import add_permission
        # Delete permission which was unintionally injected by previous migration
        orm['auth.Permission'].objects.filter(name='Verbose Name').delete()

        ct, created = orm['contenttypes.ContentType'].objects.get_or_create(
            model='login', app_label='ssheepdog')
        for codename, name in NEW_PERMISSIONS:
            add_permission(orm, codename, name)

    def backwards(self, orm):

        # Deleting field 'Login.additional_public_keys'
        db.delete_column('ssheepdog_login', 'additional_public_keys')

        # Changing field 'UserProfile.ssh_key'
        db.alter_column('ssheepdog_userprofile', 'ssh_key', self.gf('ssheepdog.fields.PublicKeyField')())


    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'})

# Path: ssheepdog/utils.py
# def add_permission(orm, codename, name, app_label='ssheepdog', model='login'):
#     ct, created = orm['contenttypes.ContentType'].objects.get_or_create(
#         model=model, app_label=app_label)
#     orm['auth.permission'].objects.get_or_create(
#         content_type=ct, codename=codename, defaults=dict(name=name))


# Path: ssheepdog/migrations/0009_auto__add_field_login_additional_public_keys__chg_field_userprofile_ss.py
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from ssheepdog.utils import add_permission

        # Delete permission which was unintionally injected by previous migration
        orm['auth.Permission'].objects.filter(name='Verbose Name').delete()

        ct, created = orm['contenttypes.ContentType'].objects.get_or_create(
            model='login', app_label='ssheepdog')
        for codename, name in NEW_PERMISSIONS:
            add_permission(orm, codename, name)

    def backwards(self, orm):

        # Deleting field 'Login.additional_public_keys'
        db.delete_column('ssheepdog_login', 'additional_public_keys')

        # Changing field 'UserProfile.ssh_key'
        db.alter_column('ssheepdog_userprofile', 'ssh_key', self.gf('ssheepdog.fields.PublicKeyField')())


    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'})

        },