Skip to content

Commit e96aba8

Browse files
committed
Update template params
1 parent 45f02db commit e96aba8

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

copier.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ project_name:
1919
2020
Do not use dots or spaces in the name; just "A-Za-z0-9-_" please.
2121
22-
controller_name:
22+
controller:
2323
type: str
2424
help: What is your new controller name?
2525

26-
controller_endpoints:
26+
endpoints:
2727
type: json
2828
help: What are your new controller endpoints?
2929
multiline: true
@@ -33,3 +33,8 @@ package_name:
3333
type: str
3434
default: "{{ project_name|lower|replace(' ','_')|replace('-','_') }}"
3535
when: false
36+
37+
controller_name:
38+
type: str
39+
default: "{{ controller|lower|replace(' ','_')|replace('-','_') }}"
40+
when: false

template/tests/unit/app/controllers/test_{{controller_name}}.py.jinja

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def client():
1111
app = get_app()
1212
with TestClient(app) as client:
1313
yield client
14-
{%- for endpoint, method in controller_endpoints.items() %}
14+
{%- for endpoint, method in endpoints.items() %}
1515

1616

1717
def test_{{endpoint}}(client):

template/{{package_name}}/app/controllers/{{controller_name}}.py.jinja

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ router = APIRouter(
88
prefix="/{{ controller_name }}"
99
)
1010
log = logging.getLogger(__name__)
11-
{%- for endpoint, method in controller_endpoints.items() %}
11+
{%- for endpoint, method in endpoints.items() %}
1212

1313

1414
@router.{{ method }}(

0 commit comments

Comments
 (0)