Q:

Django admin inline for deep relation

It's quite easy to have inline for direct relation, but how can I create inline for deeper relations?
Let's say situation is like 
class A(models.Model):
     ...

class B(models.Model):
     a = models.ForeignKey(A)

class C(models.Model):
     b = models.ForeignKey(B)

Now what I'd like to have is inline in admin for A which will show all of it's Cs with corresponding B name. How do I do that?

A:

Take a look at django-nested-inlines. From example:
from django.contrib import admin
from nested_inlines.admin import NestedModelAdmin, NestedStackedInline, NestedTabularInline
from models import A, B, C

class MyNestedInline(NestedTabularInline):
    model = C

class MyInline(NestedStackedInline):
    model = B
    inlines = [MyNestedInline,]

class MyAdmin(NestedModelAdmin):
    pass

admin.site.register(A, MyAdmin)

