--
Ticket URL: <https://code.djangoproject.com/ticket/27755>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
Are you going to offer a patch to show exactly what you have in mind? I'm
not immediately convinced that another hook is needed since the cost of
duplicating a for loop is not that great.
--
Ticket URL: <https://code.djangoproject.com/ticket/27755#comment:1>
Comment (by WeizhongTu):
If I want to realize a dynamic inlines based on the request or model
instance. I need to override `get_inline_instances` to do it.
What I want to do is just set `self.inlines` to dynamic values according
to different person or object. not `inline instances`, so I advise to add
a new hook `get_inlines(request, obj=None)` to finish such a thing.
Replying to [comment:1 Tim Graham]:
> Are you going to offer a patch to show exactly what you have in mind?
I'm not immediately convinced that another hook is needed since the cost
of duplicating a for loop is not that great.
--
Ticket URL: <https://code.djangoproject.com/ticket/27755#comment:2>
Comment (by WeizhongTu):
I've already created a new pull request here:
https://github.com/django/django/pull/7920
Replying to [comment:1 Tim Graham]:
> Are you going to offer a patch to show exactly what you have in mind?
I'm not immediately convinced that another hook is needed since the cost
of duplicating a for loop is not that great.
--
Ticket URL: <https://code.djangoproject.com/ticket/27755#comment:3>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
I guess it's useful. The patch needs some improvement (tests, some doc
fixes such as release notes) as per the PatchReviewChecklist.
--
Ticket URL: <https://code.djangoproject.com/ticket/27755#comment:3>
* owner: nobody => Hidde Bultsma
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/27755#comment:4>
* owner: Hidde Bultsma => Hasan Ramezani
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/27755#comment:5>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/27755#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"917fd9d03fdd21538864af4b412ac30b36d99268" 917fd9d0]:
{{{
#!CommitTicketReference repository=""
revision="917fd9d03fdd21538864af4b412ac30b36d99268"
Fixed #27755 -- Added ModelAdmin.get_inlines() hook.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27755#comment:7>