Skip to content

Instantly share code, notes, and snippets.

View easherma's full-sized avatar
👋

Eric Sherman easherma

👋
View GitHub Profile
@easherma
easherma / generate_factories.py
Created April 16, 2021 20:03 — forked from vkurup/generate_factories.py
Django management command to generate factory-boy boilerplate factory definitions for all the models in a given app. The code is not intended to be usable right off the bat, it just provides a few sane defaults based on the structure of your models.
from django.core.management.base import BaseCommand
from django.db.models import fields
from django.db.models.fields import related
from django.apps import apps
class Command(BaseCommand):
help = """Generate factory-boy factories for the given app"""
def add_arguments(self, parser):