Changes between Initial Version and Version 1 of Ticket #34745, comment 1


Ignore:
Timestamp:
Jul 26, 2023, 5:39:40 PM (16 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34745, comment 1

    initial v1  
    1 I don't think we offer any guarantees that an object that implements the ''compilable'' protocol (`as_sql(compiler, connection) -> tuple[str, tuple]`). Not against it but it warrants a larger discussion and would likely require the introduction of typing to the ORM to enforce properly through continuous integration.
     1I don't think we offer any guarantees that an object that implements the ''compilable'' protocol (`as_sql(compiler, connection) -> tuple[str, tuple]`) is ''enough'' to be passed around the ORM. Not against it but it warrants a larger discussion and would likely require the introduction of typing to the ORM to enforce properly through continuous integration.
    22
    33If you want to return arbitrary SQL I'd suggest using [https://docs.djangoproject.com/en/4.2/ref/models/expressions/#raw-sql-expressions RawSQL] directly or subclass it as it implements most of the implicit attributes the ORM expects.
Back to Top