Skip to content

Commit

Permalink
data wizard registration
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Sep 14, 2021
1 parent 98b9f62 commit f263137
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@
default=False,
help="Generate admin.py",
)
@click.option(
"--with-wizard/--no-wizard",
default=False,
help="Generate wizard.py",
)
@click.option(
"--force", "-f",
is_flag=True,
default=False,
help="Answer yes to all prompts",
)
def addform(xlsform, input_dir, django_dir, template_dir,
form_name, with_admin, force):
form_name, with_admin, with_wizard, force):
"""
Convert an XLSForm into a Django app for wq. Generates Python and mustache
files including:
Expand Down Expand Up @@ -114,6 +119,12 @@ def addform(xlsform, input_dir, django_dir, template_dir,
xls2django(xlsform, 'admin'),
overwrite=force,
)
if with_wizard:
create_file(
[django_dir, form_name, 'wizard.py'],
xls2django(xlsform, 'wizard'),
overwrite=force,
)

if not input_dir and os.path.exists('../master_templates'):
input_dir = '../master_templates'
Expand Down

0 comments on commit f263137

Please sign in to comment.