create_account

This module provides a Django management command to create a new Account record.

Classes

Command

Implements logic for the manage.py create_account command.

Command-line Arguments

–account_numberstr, optional

The account number for the new account.

–company_namestr, optional

The company name for the new account.

Functionality

  • If account_number is provided, attempts to find or create an Account with that number and associates the company name.

  • If only company_name is provided, finds or creates the Account based on company name.

  • Populates account details like name (in snake_case) and description for newly created accounts.

  • Success or failure status is reported to the user.

Usage Example

python manage.py create_account –account_number=<number> –company_name=”<name>” python manage.py create_account –company_name=”<name>”

class smarter.apps.account.management.commands.create_account.Command(*args, **kwargs)[source]

Bases: SmarterCommand

Create a new account.

add_arguments(parser)[source]

Add arguments to the command.

handle(*args, **options)[source]

Create the Account.