﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31426	Add proper field validation to QuerySet.order_by.	Maxim	Simon Charette	"When you annotate a QuerySet with a uuid key, the order_by functionality breaks for the uuid column because the uuid is ""not a valid order_by argument"".
\\
Changing the constant django.db.models.sql.constants.ORDER_PATTERN by allowing a ""-""
\\
from
{{{
ORDER_PATTERN = re.compile(r'\?|[-+]?[.\w]+$')
}}}
to 
{{{
ORDER_PATTERN = re.compile(r'\?|[-+]?[.\-\w]+$')
}}}
fixes this in PostgreSQL. 
\\
\\
Is there a reason the former pattern was used, is it incompatible with other dbs?"	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed	ORDER_PATTERN, order_by	Maxim	Accepted	1	0	0	0	0	0
