#34715: have proposal to create new orm method get_object_or_none same as
get_object_or_404
-------------------------------------+-------------------------------------
     Reporter:  mahavir2506          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  django orm           |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by mahavir2506:

Old description:

> I want to contribute new method get_object_or_none
> this method will be return object if object exist other wise this method
> will return None

New description:

 I  would like to propose a new method called get_object_or_none, which
 would return an object if it exists, and None otherwise. This
 functionality is often desired by developers, as it eliminates the need to
 use try-except blocks and simplifies the code where developer wants object
 if exist otherwise None.

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34715#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701895dce126a-021d7c87-8565-4991-9c3e-d7ca7d911442-000000%40eu-central-1.amazonses.com.

Reply via email to