>Instead of this hook, how about just using the existing JavaScript >hook? Either that, or we can add declarative syntax to the 'class >Admin' like so: > > class Admin: > use_custom_templates = ('field_name1', 'field_name2')
Heh, I like that. What I don't really like is the fact that still there are 4 hits per listed field - maybe the list of fieldnames could optionally be a list of field names or (field, templatename) tuples? That way you have full flexibility and full control without too much boilerplate. Actually that change would make the tagging stuff ridicoulus easy, as it would boil down to a custom template for a Many2Many field ... But one thing I think about: wouldn't it be needed to have some overrideable function to handle the data from the custom template? Because the current code still expects the data in the same format as it would have with the default template - so how would you solve that? For example the Many2Many would be a selection list, but maybe a custom template would present it as a comma-separated list of tag names in a textarea. So on submit, this field wouldn't be in the expected format - could there be a nice way to "inject" custom handlers, too? Or are we supposed to write JS hackery that produces the internal field from the used stuff in the custom template to produce the correct format internally in some hidden fields? bye, Georg