The way I'm doing this right now is bad juju. The AdminSite keeps a
registry of models and ModelAdmins so I'm doing this:
modeladmin = admin.site._registry[model];
Obviously using this internal registry is a bad idea. I was looking
for a more official api similar to get_model or one of the following:
modeladmin = admin.site.get_admin(model)
Even if this just returns the instance from the registry like above.
Or make it accessible through the model like one of the following:
modeladmin = model.get_admin()
modeladmin = model._admin
Any help with this is appreciated
Now a litlte more context. Like I mentioned above, what I actually
need is a ModelForm similar to the one generated by the admin site. I
have a custom admin view that receives the post from an add/change
form. So to process that post I need the equivalent ModelForm.
If there is an easier or more idiomatic way to write custom admin
views, I'd appreciate if someone pointed me in the right direction.