On Thu, Jan 23, 2014 at 8:29 AM, Shai Berger <[email protected]> wrote:
> Hi,
>
> I took a look at PR 2192[1] earlier, and noted that checks.register keeps
> being used as a function, called from AppConfig.ready(), and not as a
> decorator; but it is defined as a decorator, so it looks a little funny:
>
> checks.register('models')(check_generic_foreign_keys)
>
> (from the contenttypes AppConfig, for example).
>
> Registering checks only in ready(), rather than at import time, is now the
> way
> to do things, so register() should typically not be used as a decorator; I
> think we should change its definition accordingly, to
>
> def register(self, check, *tags)
>
> Thoughts?
>
> [1] https://github.com/django/django/pull/2192
That's a fair point. The decorator mode of registration has effectively
been deprecated by the move to using ready() (since there's almost
certainly no way to use it in practice. Altering the prototype to reflect
this makes sense to me.
Russ %-)
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CAJxq84-xRN7KSvTq3S7UAZaSBNerCHr6T6_OF6V0JqhPXMs-dg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.