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

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.

Not the answer you're looking for? Browse other questions tagged .