Skip to content

Conversation

LilyFirefly
Copy link
Contributor

@LilyFirefly LilyFirefly commented Nov 24, 2016

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work because I don't have access to a suitable compiler. I will also need to add support for as_sql to Q objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From #8056, it looks like I can do:

compiler = connection.ops.compiler('SQLCompiler')(None, connection, 'default')

@LilyFirefly LilyFirefly force-pushed the ticket_11964 branch 2 times, most recently from f7f256c to 89b2092 Compare February 19, 2017 23:46
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets me further. Unfortunately, I appear to need a more complete query instead of None, so Col.as_sql can be evaluated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long term, I want to be able to use Q(pink__gt=2) here, but for now using this avoids the need to implement Q.as_sql.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't really thought whether this is the best way to fix these tests, but it is sufficient for now.

@LilyFirefly LilyFirefly force-pushed the ticket_11964 branch 4 times, most recently from fc2f707 to 835f04e Compare February 26, 2017 16:40
@LilyFirefly
Copy link
Contributor Author

LilyFirefly commented Feb 26, 2017

I'm not sure where is best to put MySQL error handling. It supports the syntax, but