It is really useful to have classes such as ModelAdmin or AdminSite.
But sometimes I have feeling like author went against main moto of
newforms-admin branch and did such design, that is very hard to
customize.
For example in django/contrib/admin/sites.py is AdminSite class, which
have method as login, logout etc.:
When I want to add some little functionality (such as change title,
add my own field...) to login form, I simply override login method
like this:
def login(self, request):
result = super(ManagerSite, self).login(request)
# do some my stuff here
return result
And I want to do some change to login form. But what a surprise -
method _display_login_form used in method login is not a method - it
is function in sites.py module, so I can't override it to customize
login form (for example just change title to display site name and
version of application or send user another error message)...
So my point is question: Why _display_login_form is not a method of
AdminSite?
PS: And I have seen this strange design on more places in newforms-
admin, really can't understand the reason. Could you please explain
it to me?
Newforms-admin is very much a work-in-progress; warts like the ones
you describe are to be expected. The best thing to do now is file a
ticket; the more we know about "use cases" for newforms-admin, the
better we'll be able to handle 'em.
Jacob
Glin