Friday, August 26, 2016

Re: Attribute error, with a very basic banking app

Thanks for that Michal, I see what you mean. I've bookmarked it. Thanks to everyone for all the detailed replies it really helps make sense of CBV :) 

On Fri, Aug 26, 2016 at 3:48 PM, Michal Petrucha <michal.petrucha@koniiiik.org> wrote:
On Fri, Aug 26, 2016 at 10:29:16AM -0400, Andromeda Yelton wrote:
> In my experience, CBVs are useful when the view you want to write is
> basically a create, read, update, or delete operation on a single database
> item, or a bunch of instances of the same model (...and it turns out a lot
> of web app pages are just that). And they're useful because they let you do
> that with almost no lines of code - they take care of all the things you'd
> have to write over and over, and let you focus on the things that are
> unique to your use case.
>
> The farther away your business logic is from that, the more you need to
> understand the actual methods available and the inheritance tree and so
> forth. It took me a while to get over this hurdle too, but now that I have
> I use CBVs exclusively.

I'll just chime in with a reference to http://ccbv.co.uk/, which is an
invaluable resource whenever you're doing anything with CBVs that
involves more than setting the ``template_name`` and ``model``
attributes. In my opinion, CCBV makes a lot of the pain involved in
dealing with CBVs go away.

Cheers,

Michal

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/vXAou_bCuhE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20160826144853.GA6601%40koniiiik.org.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACaWuFT1cL7jmsUbmj3g%3Dskp9HK5VtunWxSx8i9M8%2BAqOF2yzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment