Recently, I had to make more than one admin class in admin.py file.
I have never had a situation like this before.
I keept my admin classes in separate files in admin module.
It came to me that after each class definition you have to make
admin.site.register(Class, AdminClass)
Hence:
- Where is the best place to put this call?
after a AdminClass definition?
Try it, it looks ugly
- At the end of file with other registers?
it is similar to signals connect and template_tag registering.
Therefore it should be similarly decorated by decorator.
@register_admin(class=ModelName)
class ModelAdmin:
pass
what do you think?
BTW:
This one is even more ugly than previous one!
How about changing:
model_method.allow_tags = True
model_method.short_description = _( 'Model Method' )
into:
@options(allow_tags=True, short_description=_('Model Method'))
or:
@allow_tags
@short_desctiption(_('Model Method'))
?
--
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.