Is there a reason these features cannot be added inside Django core?

194 views
Skip to first unread message

Luis Masuelli

unread,
Jan 12, 2016, 10:21:29 AM1/12/16
to Django developers (Contributions to Django itself)
These features are pretty core-related.

1. Features from django-polymorphic. To mantain bw compatibility, the hierarchy parent could need to add something like polymorphic=True in the meta to this feature be activated.
2. Something like this snippet regarding Inlines in admin: https://djangosnippets.org/snippets/2032/, to be able to do this:

class A(models.Model):

    b
= OneToOneField('B')

class B(models.Model):

   
...

class AInlineAdmin(StackedInline):

    model
= A

class BAdmin(ModelAdmin):

    inlines
= (AInlineAdmin)

site
.register(B, BAdmin)

Sometimes, doing this could be desirable as it was in my case.

Additionally, I don't know if it is a feature or a bug, but when I see the inline model section for a O2O field, the section is labeled as:

(verbose_name_plural)
(verbose_name) #1

Example (the Customer model admin has an inline to ContactDetails; the ContactDetails model has a direct O2O field to Customer; in this case I didn't use the reverse inline snippet I posted above, but the standard supported way):

Contacts Details
Contact Details #1

Even when there is only one element (since it is a O2O). Could a change be done for that case so these captions become...

(verbose_name)
(nothing)

only for the O2O case? (both in the standard way and -if you decide to support- the inverse inline)

Tim Graham

unread,
Mar 7, 2016, 11:18:09 AM3/7/16
to Django developers (Contributions to Django itself)
1. This has been raised before, but it seems there's not much interest. See also: https://groups.google.com/d/topic/django-developers/jsMlF6u4yxU/discussion

2. Here's a tentatively accepted ticket for editing OneToOne related models as inlines: https://code.djangoproject.com/ticket/21135

For future reference, it's probably better to raise one issue per thread so that you can use a subject line that corresponds to each feature.
Reply all
Reply to author
Forward
0 new messages