djangoldp-notification/djangoldp_notification/management/commands/mock_notification.py

13 lines
499 B
Python
Raw Normal View History

2019-01-11 10:46:23 +00:00
from django.core.management.base import BaseCommand, CommandError
from djangoldp_notification.factories import NotificationFactory
class Command(BaseCommand):
help = 'Mock data'
def add_arguments(self, parser):
parser.add_argument('--size', type=int, default=0, help='Number of notifications to create')
def handle(self, *args, **options):
2019-01-14 08:35:20 +00:00
NotificationFactory.create_batch(options['size'])
2019-01-11 10:46:23 +00:00
self.stdout.write(self.style.SUCCESS('Successful data mock install'))