Skip to main content

Docs - Topic Guides

for p in Person.objects.raw('SELECT * FROM myapp_person')
print(p)

https://docs.djangoproject.com/en/2.0/topics

How to Guides

https://docs.djangoproject.com/en/2.0/howto

API Reference

https://docs.djangoproject.com/en/2.0/ref

Management Command

class Command(BaseCommand):

def add_arguments(self, parser):
parser.add_argument(
'--customer',
action='store',
dest='customer_name',
default=None,
help='Customer name for which device dump has to be generated'
)

parser.add_argument(
'--only_upload_folder_name',
action='store',
dest='only_upload_folder_name',
default=None,
help="Set to true if generated files for a customer only need to be uploaded to drive"
)

def handle(self, *args, **options):
customer_name = options ['customer_name']
only_upload_folder_name = options ['only_upload_folder_name']