<commit_before># -*- coding: utf-8 -*-
import pdb

import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from guardian.shortcuts import assign
from django.contrib.auth.models import Group


class Migration(DataMigration):

    def forwards(self, orm):
        "Write your forwards methods here."
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        permission = 'view_ComicSiteModel'
        
                
        if not db.dry_run:
            print "Everyone should be able to see uploaded files by default for now. giving\
                  '"+permission+"' permission to 'everyone' user for the following UploadModel\
                  instances: "
            
            everyonegroup = orm['auth.Group'].objects.get(name="everyone")
            evg = Group.objects.get(name="everyone")
            # For permissions to work properly after migrating
            for uploadmodel in orm['comicmodels.UploadModel'].objects.all():
                pdb.set_trace()
                assign(permission,evg,uploadmodel)
                
                print uploadmodel.file
                #uploadmodel.setpermissions(uploadmodel.ALL)
                
            
        

    def backwards(self, orm):
        "Write your backwards methods here."

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},<commit_msg>removed pdb from migration 0008, left there by accident<commit_after># -*- coding: utf-8 -*-
import pdb

import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from guardian.shortcuts import assign
from django.contrib.auth.models import Group


class Migration(DataMigration):

    def forwards(self, orm):
        "Write your forwards methods here."
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        permission = 'view_ComicSiteModel'
        
                
        if not db.dry_run:
            print "Everyone should be able to see uploaded files by default for now. giving\
                  '"+permission+"' permission to 'everyone' user for the following UploadModel\
                  instances: "
            
            everyonegroup = orm['auth.Group'].objects.get(name="everyone")
            evg = Group.objects.get(name="everyone")
            # For permissions to work properly after migrating
            for uploadmodel in orm['comicmodels.UploadModel'].objects.all():                
                assign(permission,evg,uploadmodel)
                
                print uploadmodel.file
                #uploadmodel.setpermissions(uploadmodel.ALL)
                
            
        

    def backwards(self, orm):
        "Write your backwards methods here."

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
{'fraction_non_alphanumeric': 0.08891928864569083, 'fraction_numerical': 0.0027359781121751026, 'mean_word_length': 1.981651376146789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7250407', 'n_tokens_mistral': 754, 'n_tokens_neox': 722, 'n_words': 222}