Joseph Kocherhans wrote:
> On 1/11/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
> > On 1/11/06, Radek Svarz <[EMAIL PROTECTED]> wrote:
> > > Could you follow some uniform way of the pluralization of module names?
> > >
> > > I mean why there is django.shortcuts.views (plural) and django.form
> > > (singular)?
> > >
> > > I hate those code mistakes when just one s is forgotten.
> >
> > You're right. 'forms' fits better with the top level packages than
> > 'form' anyhow. I'll change the wiki.
>
> Hmm... what about django.template (singular) becoming django.templates
> (plural)? Any strong preferences? I think templates makes more sense.
>
> Joseph
Plurals are good: forms + templates
One thing that nobody has yet expressed an opinion about was the
suggestion to provide new module attribute names to facilitate
readability when importing the second level packages (which I would
suggest becomes the recommended usage):
---
from django import http, templates
def basic_view(request):
# templates gains functions currently in template.loader ? rename
t = templates.get('mytemplate')
c = templates.Context({'name':'yehudi'})
# http classes lose Http prefix
return http.Response(t.render(c))
---
Other candidates for renaming in template.loader would be
select_template -> select, get_template_from_string -> from_string,
find_template_source -> find_source
One issue is that if Http404 goes into http we can't have http.404.
I have seen other frameworks use http.FourOhFour but I prefer
http.NotFound
Kieran