[Suggestion] Create Django view method

Hello,

I think that "Create Django view method" feature is great. Just a small idea how to improve it.

  1. It's a common pattern to keep subdirectory in templates directory, one for each application. In every subdir we keep HTML files which are templates for single views of the application. Ex. there is an app A with view index, so our templates folder structure is templates/A/index.html. With this assumption, it'd be great if those would be default values in Create View Method window.
  2. Even if it isn't possible to make it default, I think it'd be useful to enter template folder related value to Template name field. Ex., "A/index". Now, it isn't possible do enter a slash there.
  3. Moreover, if we enter just a file name into Template name field and a directory name to Template folder (ex. "index" and "A"), the template file is created correctly (in a subdir), but... we still get just a file name in generated view, ie. render_to_response('index.html') instead of render_to_response('A/index.html'). It will bring us to TemplateDoesNotExist exception, so I think it can be found as a bug.

Regards,

Marcin

2 comments

Hello Marcin,

Could you please file your improvement suggestions as feature requests in

our issue tracker? http://youtrack.jetbrains.net/

I think that "Create Django view method" feature is great. Just a

small idea how to improve it.

1. It's a common pattern to keep subdirectory in templates directory,

one for each application. In every subdir we keep HTML files which are

templates for single views of the application. Ex. there is an app A

with view index, so our templates folder structure is

templates/A/index.html. With this assumption, it'd be great if those

would be default values in Create View Method window.

2. Even if it isn't possible to make it default, I think it'd be

useful to enter template folder related value to Template name field.

Ex., "A/index". Now, it isn't possible do enter a slash there.

3. Moreover, if we enter just a file name into Template name field and

a directory name to Template folder (ex. "index" and "A"), the

template file is created correctly (in a subdir), but... we still get

just a file name in generated view, ie.

render_to_response('index.html') instead of

render_to_response('A/index.html'). It will bring us to

TemplateDoesNotExist exception, so I think it can be found as a bug.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Please sign in to leave a comment.