On Thu, Jul 24, 2008 at 9:54 AM, zvoase <[EMAIL PROTECTED]> wrote:
> Developers,
> I've just looked at the latest revision (r8068) for Django and there
> are a couple of things I'd like to suggest.

I've already replied to part of this email, but I'd like to take a
minute to also reply to the other portion, now that I've taken the
time to read through it.

> I propose the addition of 4 decorator functions, to
> ``django.contrib.admin`` (or a relevant submodule), which could be
> used to decorate functions so that these attributes could be set
> automatically, like so::
>
>        class MyModel(models.Model):
>                ...
>
>                @short_description('Custom method...')
>                def custom_method(self):
>                        return something()
>
> I feel that this way is far more Pythonic, and makes code look a lot
> nicer. I've put some Python source at the end of this message which
> demonstrates the idea, and defines a generic attribute-setting
> decorator-making function which allows more decorators to be created
> if the admin changes in the future.

This sounds awfully familiar, and I don't know why. Oh wait, yeah I
do! I proposed this very thing about two years ago. At the time I was
more focused with just the alters_data attribute, but the idea is the
same. Please take a quick read through the comments on the ticket[1]
to see why this has been rejected in the past.

-Gul

[1] http://code.djangoproject.com/ticket/3009

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to