diff options
| author | django-bot <ops@djangoproject.com> | 2022-02-08 12:09:55 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-08 12:15:38 +0100 |
| commit | 6a682b38e75d4c975b4c4493565a59f1bc14397c (patch) | |
| tree | 0bd9cda550bea26238656d9f120d769e8b41bb9e /tests/custom_methods/models.py | |
| parent | e73ce08888e6f34d3f050377cfd2fbb733be94a9 (diff) | |
[4.0.x] Refs #33476 -- Reformatted code with Black.
Backport of 9c19aff7c7561e3a82978a272ecdaad40dda5c00 from main.
Diffstat (limited to 'tests/custom_methods/models.py')
| -rw-r--r-- | tests/custom_methods/models.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/custom_methods/models.py b/tests/custom_methods/models.py index f44d1b8265..1ff823297d 100644 --- a/tests/custom_methods/models.py +++ b/tests/custom_methods/models.py @@ -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()] |
