mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
* module docstrings * db schema graph * dev docs first pass * dev docs pass 2 * add generated notification to top of generated docs files * linting * regen docs Co-authored-by: Stefan Pratter <stefan@20c.com> Co-authored-by: Sunshine Buchholz <sunshine@20c.com>
20 lines
503 B
Python
20 lines
503 B
Python
"""
|
|
Base class to use for command creation.
|
|
"""
|
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
|
class PeeringDBBaseCommand(BaseCommand):
|
|
def add_arguments(self, parser):
|
|
parser.add_argument("--commit", action="store_true", help="Commit the changes.")
|
|
|
|
def log(self, msg):
|
|
if self.commit:
|
|
self.stdout.write(msg)
|
|
else:
|
|
self.stdout.write(f"[pretend] {msg}")
|
|
|
|
def handle(self, *args, **options):
|
|
self.commit = options.get("commit")
|