4

There's a 5 year old question on SO where the correct usage in Django was get_query_set. Since Django 1.6 (released Nov 2013) the correct usage is get_queryset. I edited the answer since I thought it's better to keep the answer up to date with changes in the language. A user didn't like this change and changed it back to the outdated syntax.

I was wondering what is SO's policy on editing code snippets in order to keep it updated with changes in the framework?

For me it makes sense to update it, but would appreciate other views.

4
  • 2
    Related: meta.stackoverflow.com/q/265763/215552. Basically, the person who originally asked the question was not asking about that version of Django, so answers which use syntax from newer versions don't answer the question as asked. If you'd like to answer for a newer version, create a new answer, crediting and linking to the other answer, with your edit. Commented Oct 14, 2016 at 16:02
  • An absurd of the system... meta.stackoverflow.com/q/290017/792066 Commented Oct 15, 2016 at 2:25
  • BTW, help center: Edits are expected to be substantial and to leave the post better than you found it. Common reasons for edits include: [...] To correct minor mistakes or add updates as the post ages, also related meta.stackexchange.com/q/261817/213575 Commented Oct 15, 2016 at 2:30
  • Also... meta.stackoverflow.com/q/316817/792066 Commented Oct 15, 2016 at 2:36

1 Answer 1

2

Changing existing working code is generally not a welcome edit.

If question has version-specific tag (like "C#-2.0") you should not add answers for different versions or edit existing answers for new version. Ask new question instead with generic/new version-specific tag. Feel free to promote new question with comment on old one / link back from new one.

If you decide to create new self-answered question consider if original should be closed as duplicate. Collect opinions of others before closing (I personally would not gold-hammer in this case).

Alternatively consider to broaden existing question by adding non-version specific tag and provide answers for multiple versions. Be careful to not invalidate existing answers - I would avoid that route.

If question has no version-specific tag - either edit answer with clear indication that new version needs new syntax and preserve original text/code with corresponding version remark (when it is close enough) or add new answer. Do not change code that works with version that was latest at the point when question was asked. Adding new answer is generally easier to justify so.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.