Skip to content
Snippets Groups Projects
Select Git revision
  • 4c26e8852f9dfb1a412f8e883a01196b54b953c0
  • master default protected
  • patch-upgrade-scm
  • Develop-multiwell-analysis
  • Nadia
  • 0.3.3
  • 0.3.2
  • 0.3.1
8 results

__main__.py

Blame
  • a_command.py 708 B
    from io import StringIO
    
    from django.db import models
    from django_diu import import_command
    
    from tests.models import AModel
    
    class AImportTask(import_command.ListImportTask):
    
        description = "A very basic 'import from list' test task"
    
        DATA = [
            'A','B','C','D'
        ]
    
        option = "a"
    
        target_classes = [AModel]
    
        main_class = AModel
    
        depends_on = []
    
        def migrate_row(self, row):
            a = AModel()
            a.a_field = row[0]
            a.save()
            return a
    
    
    class Command(import_command.ImportCommand):
    
        help = "Test command to test django-diu's ImportCommand"
    
        # list all the import tasks that should be available via the command
        task_classes = [AImportTask]