newforms-admin _display_login_form and other as function?

3 views
Skip to first unread message

Glin

unread,
Aug 1, 2007, 9:46:42 AM8/1/07
to Django developers
Hi,
I'm using newforms-admin branch, as it aim to be easily customizable
(besides that oldforms will be removed soon).

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?

Jacob Kaplan-Moss

unread,
Aug 1, 2007, 10:48:01 AM8/1/07
to django-d...@googlegroups.com
Hi Glin --

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

unread,
Aug 2, 2007, 2:40:51 AM8/2/07
to Django developers
OK, I wasn't sure, if there is not some reason for this - and for
asking is better forum than ticket ;-). I'll try create a ticket.

Glin

Reply all
Reply to author
Forward
0 new messages