On 03/09/14 14:21, Anssi Kääriäinen wrote:

> For example, lets consider the get_query_set() -> get_queryset() naming
> change done in 1.6. If 3rd party library writers change the method name
> to get_queryset() for 1.6, then their code won't work in 1.5. If they
> don't do the change, then all users trying to run with -Wall will get a
> bunch of deprecation warnings they can't do much about. This will
> effectively ruin the "run with -Wall" advice.
> 
> The usual way to solve these kinds of problems in code that needs to
> work in multiple Django versions is to write code which is conditional
> on Django's version. It looks a bit ugly to define methods
> conditionally, but in practice this works extremely well.
> 
> So, when adding a new deprecation to Django, we should document how 3rd
> party library writers can write code that works *silently* both before
> and after the feature deprecation is added. If there is no easy way to
> achieve that, then we should reconsider the deprecation.

Regarding get_queryset, it's possible to do it without warnings I think,
and the RenameMethodsBase class helps, but it's not entirely
straightforward.

I've added a paragraph to the docs that documents how to do it correctly
for the get_queryset renamings, and I agree that we should make this
kind of thing a standard practice. It might bloat the release notes a
bit, but I think that in general people appreciate the detail.

Luke


-- 
"Cross country skiing is great if you live in a small country."
(Steven Wright)

Luke Plant || http://lukeplant.me.uk/

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" 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/542D305C.2010206%40cantab.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to