Skip to content

Commit 0a258b7

Browse files
committed
Comment on my ambivalence about db.one
1 parent 325abc6 commit 0a258b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

postgres.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ def one_or_zero(self, sql, parameters=None):
353353

354354

355355
def one(self, sql, parameters=None, strict=None):
356+
357+
# I'm half-considering dropping this. Now that one_or_zero exists, this
358+
# is really only useful for what should really be called db.first, and
359+
# in that case why aren't you using a LIMIT 1?
360+
356361
"""Execute a query and return a single result.
357362
358363
:param unicode sql: the SQL statement to execute

0 commit comments

Comments
 (0)