tickets_full: 10939

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
10939 2009-04-27 23:20:12 2009-08-06 22:07:56 2019-06-24 02:13:57.820401 Unreviewed closed contrib.admin     1.0 invalid Allow for dynamic registration of inlines into an admin model It used to be (django 0.96) you could arbitrarily add inlines into an admin model: {{{ from django.db import models from django.contrib.models import FlatPage class FlatPageAttachment(models.Model): flatpage = models.ForeignKey(FlatPage, edit_inline=True) attachment = models.FileField(upload_to="flatpages") }}} Now this is not possible. You could try to import the FlatPage admin and attach an admin inline, but this will not work. The reason for this is that when the Admin model is registered into the admin site, it goes through and populates inline_instances. It is true you could unregister and re-register, but what if another app also wanted to add an inline? If that was the case then only one would get its inline registered. Perhaps a better alternative is to add a method to ModelAdmin called "register_inline". It would behave something like the following: {{{ def register_inline(self, inline_class): inline_instance = inline_class(self.model, self.admin_site) self.inline_instances.append(inline_instance) }}} nobody zbyte64 inlines   0 0 0 0  
Powered by Datasette · Query took 2.625ms