config_models.management.commands package#
Submodules#
config_models.management.commands.populate_model module#
Populates a ConfigurationModel by deserializing JSON data contained in a file.
- class config_models.management.commands.populate_model.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommand
This command will deserialize the JSON data in the supplied file to populate a ConfigurationModel. Note that this will add new entries to the model, but it will not delete any entries (ConfigurationModel entries are read-only).
- add_arguments(parser)#
Entry point for subclassed commands to add custom arguments.
- handle(*args, **options)#
The actual logic of the command. Subclasses must implement this method.
- help = '\n Populates a ConfigurationModel by deserializing the supplied JSON.\n\n JSON should be in a file, with the following format:\n\n { "model": "config_models.ExampleConfigurationModel",\n "data":\n [\n { "enabled": True,\n "color": "black"\n ...\n },\n { "enabled": False,\n "color": "yellow"\n ...\n },\n ...\n ]\n }\n\n A username corresponding to an existing user must be specified to indicate who\n is executing the command.\n\n $ ... populate_model -f path/to/file.json -u username\n '#