On Fri, Nov 5, 2010 at 11:40 PM, Valentin Golev <[email protected]> wrote:
> Are you certain about self.instance?
> http://code.djangoproject.com/browser/django/trunk/django/views/generic/edit.py Lines
> 173 and 90 tell me another thing...

I didn't say self.instance. I said *form*.instance.

> Well, Django can provide tools for extending views with either decorators or
> mixins (or both - won't it cause uncertainity? maybe with some
> recommendation). Like the one from my example,
> django.contrib.auth.decorators.login_required can be transformed into Mixin.
> Will it be?

Unlikely, because login is a natural fit for a decorator.

You have a view. The operation of that view can be a black box with
regards to login. The decorator can check login status, and redirect
if you're not logged in; or call the black box if you are.

Sure, you *could* implement this as a mixin, but I'm not sure I see
the gain in offering two ways to do the same thing.

Yours,
Russ Magee %-)

-- 
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