Making inlines conditional in the Django admin
I have a model that I want staff to be able to edit up to the date for the event. Like this: class ThingAdmin(admin.ModelAdmin): model = Thing if obj.date < today: #Something like that inlines = [MyInline,] The problem is, I don't have access to the obj instance at this level. I've tried overriding get_formset(), but didn't get anywhere. Please advise? Thanks to the comments for a change in 1.4. My implementation here wasn't thread safe either, so it really should have been deleted. Since get_formsets is passed the object and calls get_inline_instances , we can modify both functions to act on