Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Django Queryset Coding Convention
Employee.objects.\
filter(name='test', id=5).\
select_related('tasks').\
order_by('first_name', 'last_name')
Employee.objects.\
filter(
name='test',
id=5).\
select_related(
'tasks').\
order_by(
'first_name',
'last_name')
Employee.objects.filter(
name='test',
id=5
).select_related(
'tasks'
).order_by(
'first_name',
'last_name'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment