On 2007-12-16 21:04:10 -0700, "James Bennett" <[EMAIL PROTECTED]> said:
> > While playing around a bit with newforms-admin, I noticed that it's > ever-so-close to being able to handle one cool use case which came up > during the design discussion at PyCon: running django.contrib.admin > without django.contrib.auth. > > The implemention of has_permission() on AdminSite, and > has_(add|change|delete)_permission() on ModelAdmin, gets it almost all > the way there, but leaves two stumbling blocks: > > 1. Creating instances of LogEntry, which FK to > django.contrib.auth.models.User, and > 2. Creating instances of Message, which also FK to > django.contrib.auth.models.User. > > Right now, you *can* work around this by overriding/duplicating a lot > of code in ModelAdmin, but factoring out log entries and messages into > methods -- similar to what's already been done with permission checks > -- would make that unnecessary. > > I'm not particularly attached to these method names, but adding > methods on ModelAdmin, say, log_action() and send_user_message(), and > having the object-saving code call those methods instead of directly > handling logging and messages, would solve this pretty cleanly (and > also add a little bit more useful functionality for someone who wants > to roll their own implementation of these features). > > Anyone have strong feelings one way or another? +1. There are a few other places in ModelAdmin that should be split out into its own method, but unrelated to this. This would definitely solve this problem cleanly for those looking for this feature. -- Brian Rosner http://oebfare.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---