dudarev / photoplanet

Project for learnpython.dn.ua
http://dudarev.github.io/photoplanet/
7 stars 7 forks source link

what do you think about it ? #1

Closed artemzi closed 9 years ago

artemzi commented 11 years ago

here is example(commit) - https://github.com/unSaint/photoplanet-1/commit/fe7a7e4b566fb9e4363562cdb52664648db34550

question is: why we use LoginRequiredMixin instead of login_required?

artemzi commented 11 years ago

i understand it`s only required login, and LoginRequiredMixin - do all validation... :)

dudarev commented 11 years ago

I'll explain it more in "Questions and Answers document in Google Docs". But to answer it briefly, using LoginRequiredMixin seems more natural with CBV. It makes code more concise and more readable. With FBV it is natural to use @login_required decorator for the same purpose.