--
Ticket URL: <https://code.djangoproject.com/ticket/33384>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
Ticket URL: <https://code.djangoproject.com/ticket/33384#comment:1>
Old description:
> In Django we have `get` method for getting model objects.
> I have seen so many projects that implement `get_or_none` method in their
> projects.
> I know that we have `get_object_404` but sometimes we don't want to raise
> an exception.
> so I think `get_or_none` would be kinda useful, what do you think?
New description:
In Django we have `get` method for getting model objects.
I have seen so many projects that implement `get_or_none` method in their
projects.
There are also some python ORMs that have this feature for example
`tortoise-orm`, `ormar`, etc.
I know that we have `get_object_404` but sometimes we don't want to raise
an exception.
so I think `get_or_none` would be kinda useful, what do you think?
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33384#comment:2>
Old description:
> In Django we have `get` method for getting model objects.
> I have seen so many projects that implement `get_or_none` method in their
> projects.
> There are also some python ORMs that have this feature for example
> `tortoise-orm`, `ormar`, etc.
> I know that we have `get_object_404` but sometimes we don't want to raise
> an exception.
> so I think `get_or_none` would be kinda useful, what do you think?
New description:
In Django we have `get` method for getting model objects.
I have seen so many projects that implement `get_or_none` method in their
projects.
There are also some python ORMs that have this feature for example
`tortoise-orm`, `ormar`, `peewee`, etc.
I know that we have `get_object_404` but sometimes we don't want to raise
an exception.
so I think `get_or_none` would be kinda useful, what do you think?
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33384#comment:3>
* status: new => closed
* resolution: => duplicate
* component: Uncategorized => Database layer (models, ORM)
Comment:
Duplicate of #2659 and #11352, both of which were wontfixed.
--
Ticket URL: <https://code.djangoproject.com/ticket/33384#comment:4>