This repository has been archived on 2021-04-21. You can view files and clone it, but cannot push or open issues or pull requests.
djangoldp-webpushnotification/djangoldp_example/management/commands/mock_example.py
Nicolas Mérigot 39d3f304e5 Initial commit
2019-01-11 15:15:11 +01:00

13 lines
493 B
Python

from django.core.management.base import BaseCommand, CommandError
from djangoldp_example.factories import ExampleFactory
class Command(BaseCommand):
help = 'Mock data'
def add_arguments(self, parser):
parser.add_argument('--size', type=int, default=0, help='Number of example to create')
def handle(self, *args, **options):
ExampleFactory.create_batch(options['size'], thread=thread)
self.stdout.write(self.style.SUCCESS('Successful data mock install'))