mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #33476 -- Reformatted code with Black.
This commit is contained in:
parent
f68fa8b45d
commit
9c19aff7c7
1992 changed files with 139577 additions and 96284 deletions
|
@ -28,11 +28,14 @@ class Article(models.Model):
|
|||
database query for the sake of demonstration.
|
||||
"""
|
||||
from django.db import connection
|
||||
|
||||
with connection.cursor() as cursor:
|
||||
cursor.execute("""
|
||||
cursor.execute(
|
||||
"""
|
||||
SELECT id, headline, pub_date
|
||||
FROM custom_methods_article
|
||||
WHERE pub_date = %s
|
||||
AND id != %s""", [connection.ops.adapt_datefield_value(self.pub_date),
|
||||
self.id])
|
||||
AND id != %s""",
|
||||
[connection.ops.adapt_datefield_value(self.pub_date), self.id],
|
||||
)
|
||||
return [self.__class__(*row) for row in cursor.fetchall()]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue