To answer the unanswered q's: Meta is where you define things about the class, but are not in the class. If you can imagine a space created that *all* classes would need, mine as well as yours, this is in Meta. It's "Meta". IE. How does this class sort? Should a couple of fields be "unique together", do you want it's table to have a particular name in the database - things that have sensible defaults, are common across all classes, but can be changed.
"pk" is also known as "id" and stands for "primary key". This is a fundamental of relational databases - every tuple has an identifying element, usually table name and pk/id. In days gone by we used to have things UUID (universally unique id) or GUID (Globally Unique Identifier) - and they tended to look like this a603732f-2314-4a34-b06e-3f016dd7a54c Django largely hides the pk away, so that you don't need to worry about it, although it can be useful in day to day use if you don't have a particular identifying need - the biggest problem with a long string of hex is that it's hard to look at it and say "oh, that's John's tuple". the slug_field is an URL shortener that makes identifying an object via URL easier. eg: John's tuple: (without slug, with ugly uuid) http://myapp.com/a603732f-2314-4a34-b06e-3f016dd7a54c or (with slug = name) http://myapp.com/john-smith Originating from newspaper urls, it's why you now get the easier to recall: http://boingboing.net/2014/11/16/band-releases-unplayable-glass.html It's not only got a slug, but also the date - so should there ever be the need for another article about unplayable glass master discs, it can still be unique (via Meta) I hope that helps. On 7 January 2015 at 00:49, Brad Rice <bradri...@gmail.com> wrote: > Does anyone have a recommendation for intermediate reading to understand > Class Based Views? It seems most of the Django books were written when > function based views were prevalent. I'm still having trouble understanding > what the differences are between CreateView and UpdateView and what Meta is > as well as slug_field and pk. Perhaps my issue is understanding Object > oriented python? I wish there were some tutorials or cookbooks that offer > better understanding. > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/7fac53a2-7ff6-488f-903f-ed46edf15deb%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- ------ "We are at once both obnoxious and indispensable." - John Ngumi on the Kikuyu in It's Our Turn To Eat, by Michela Wrong. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGBeqiNTDSq3qenDad1oh9PqO9BuL8wGSNomc%3DvM%2BusJPAvL4w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.