Skip to content
Snippets Groups Projects
Select Git revision
  • 9e235539d04d2798f802d2370b616b891f6326ce
  • main default protected
  • torch2
  • torch1
  • dev protected
  • 20230311_new_default
  • 20230311
  • design protected
  • 20230129
  • 20230111
  • 20221005 protected
  • 20220418 protected
  • v0.20
  • v0.19
  • v0.18
  • v0.17
  • v0.16.4
  • v0.16.3
  • v0.16.2
  • v0.16.1
  • v0.16
  • v0.15
  • v0.14
  • v0.13
  • v0.12.4
  • v0.12.3
  • v0.12.2
  • v0.12.1
  • v0.12
  • v0.11
  • v0.10
  • v0.9.1
32 results

make_dataset.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]