Re: Renaming apps.has_app

2014-01-06 Thread Andre Terra
On Sun, Jan 5, 2014 at 7:38 PM, Raffaele Salmaso wrote: > On Sun, Jan 5, 2014 at 10:11 PM, Aymeric Augustin > wrote: > > `apps.has_app(...)` is technically correct but I think we can find a > better name. My current favorite is

Re: Renaming apps.has_app

2014-01-06 Thread German Larrain
+1 for is_installed Aymeric, thanks for your work -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post

Re: Renaming apps.has_app

2014-01-05 Thread Luc Saffre
On 06/01/14 00:26, Aymeric Augustin wrote: > On 5 janv. 2014, at 22:54, Shai Berger wrote: > >> I'd go for __contains__: >> >> if "django.contrib.auth" in apps: > > I considered this one but I didn’t select it because it will restrict our > freedom in the future. > >

Re: Renaming apps.has_app

2014-01-05 Thread Russell Keith-Magee
On Mon, Jan 6, 2014 at 5:47 AM, Aymeric Augustin < aymeric.augus...@polytechnique.org> wrote: > On 5 janv. 2014, at 22:27, Josh Smeaton wrote: > > > The only thing I have against it is that it may sound like it can take > an iterable of app names, where has_app() does not

Re: Renaming apps.has_app

2014-01-05 Thread Jorge Cardoso Leitão
Hi. First of all, a hug to Aymeric for this, very nice work! My first thought was also on "is_installed", which seems natural. But, on my second thought, the "has_app" is not that bad because it is a method of the "app loading"; i.e. the apps "having" something makes sense than "being"

Re: Renaming apps.has_app

2014-01-05 Thread Curtis Maloney
On 6 January 2014 10:11, Shai Berger wrote: > On Sunday 05 January 2014 23:26:12 Aymeric Augustin wrote: > > If I were to add magic methods on the app registry I’d probably make it a > > dict of app_label => app_config. This is the most common use case. > > > > Then it would

Re: Renaming apps.has_app

2014-01-05 Thread Shai Berger
On Sunday 05 January 2014 23:26:12 Aymeric Augustin wrote: > On 5 janv. 2014, at 22:54, Shai Berger wrote: > > I'd go for __contains__: > > if "django.contrib.auth" in apps: > I considered this one but I didn’t select it because it will restrict our > freedom in the future.

Re: Renaming apps.has_app

2014-01-05 Thread Aymeric Augustin
On 5 janv. 2014, at 22:54, Shai Berger wrote: > I'd go for __contains__: > > if "django.contrib.auth" in apps: I considered this one but I didn’t select it because it will restrict our freedom in the future. If I were to add magic methods on the app registry I’d

Re: Renaming apps.has_app

2014-01-05 Thread Kevin Christopher Henry
+1 for "is_installed" I don't find the grammar objectionable here, just think of it as "is_(each one of these apps)_installed" On Sunday, January 5, 2014 3:50:45 PM UTC-6, Aymeric Augustin wrote: > > On 5 janv. 2014, at 22:38, Raffaele Salmaso > > wrote: > > > Should

Re: Renaming apps.has_app

2014-01-05 Thread Shai Berger
On Sunday 05 January 2014 22:47:22 Aymeric Augustin wrote: > On 5 janv. 2014, at 22:27, Josh Smeaton wrote: > > The only thing I have against it is that it may sound like it can take an > > iterable of app names, where has_app() does not have that problem. > What about

Re: Renaming apps.has_app

2014-01-05 Thread Aymeric Augustin
On 5 janv. 2014, at 22:38, Raffaele Salmaso wrote: > Should it takes a list of apps, just to replace > apps.is_installed('djagno.contrib.sites') and > apps.is_installed('django.contrib.admin') and ... > with > apps.is_installed('django.contrib.sites',

Re: Renaming apps.has_app

2014-01-05 Thread Raffaele Salmaso
On Sun, Jan 5, 2014 at 10:11 PM, Aymeric Augustin wrote: > `apps.has_app(...)` is technically correct but I think we can find a better > name. My current favorite is `apps.installed(…)`. It’s quite short and it’s > reminiscent of INSTALLED_APPS. That makes

Re: Renaming apps.has_app

2014-01-05 Thread Aymeric Augustin
On 5 janv. 2014, at 22:27, Josh Smeaton wrote: > The only thing I have against it is that it may sound like it can take an > iterable of app names, where has_app() does not have that problem. What about is_installed? -- Aymeric. -- You received this message

Re: Renaming apps.has_app

2014-01-05 Thread Josh Smeaton
+1 on .installed() as it reads quite well. The only thing I have against it is that it may sound like it can take an iterable of app names, where has_app() does not have that problem. app_installed() is more accurate but is longer and less nice to read. My 2 cents. Cheers, Josh -- You

Re: Renaming apps.has_app

2014-01-05 Thread Jannis Leidel
On 05.01.2014, at 22:11, Aymeric Augustin wrote: > Hello, > > During the app_loading refactor, I introduced a method to test if a given > application is enabled, and I named it `has_app`. > > Its main uses are detecting misconfigurations: > >if

Renaming apps.has_app

2014-01-05 Thread Aymeric Augustin
Hello, During the app_loading refactor, I introduced a method to test if a given application is enabled, and I named it `has_app`. Its main uses are detecting misconfigurations: if not apps.has_app('django.contrib.admin'): raise ImproperlyConfigured("Put