On Tue, 2008-12-02 at 10:07 +0800, Earl Lapus wrote:
> On Tue, Dec 2, 2008 at 9:50 AM, Malcolm Tredinnick
> <[EMAIL PROTECTED]> wrote:
> >
> >
> > Yes, because admin.site.root isn't a function. It's a method on a class
> > (which implies a difference in the way things are called).
> >
> > There's a bit of history going on here: in the early days, all the view
> > functions had to be strings. We realised it was a bit limiting, because,
> > amongst other things, it can get quite verbose and it prevented usings
> > things like class methods or objects with a __call__ function. Thus, the
> > ability to use proper Python objects there was added a few years ago.
> >
> > Regards,
> > Malcolm
> >
> 
> Okay. To sum this all up, it's safe to say that single quotes should
> be applied only if you're calling a function in a module

Well, you can stop at that point (you don't need the second part, since
class methods aren't module-level functions). Realise also that using
the string form -- and it's just a normal Python string, so whether you
use single quotes or double quotes or even triple quotes is up to you --
is entirely optional. Personally, I prefer to avoid using the string
version altogether, so that I know I've imported the right functions
(not typos in the string) and because it usually ends up being shorter.
But it's entirely personal preference.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to