Q:

Seeking complete example of class based views crud, including template

Django 1.3 documentation on class based views is seeming like a treasure hunt. How to write the class is clear enough... but what kind of template code matches each generic class? Would someone provide a complete example soup to nuts? Here's what I have so far:
urls.py
(r'^brand_create2$',    BrandCreate.as_view()),

views.py
from django.views.generic import CreateView
@login_required
class BrandCreate(CreateView):
    template_name       = 'generic_form_popup.html'
    context_object_name = "brand_thingie"
    #queryset            = models.Brand.objects.all()
    success_url         = '/'

generic_form_popup.html
????

In this case I'm exploring if it is worth learning the new style, given the older style still works:
urls.py
url(r'^brand_create1$', 'coat.views.brand_create'),

views.py
class formBrand(forms.ModelForm):
    class Meta:
        model = models.Brand
        exclude = ('')

@login_required
def brand_create(request):

    form = formBrand
    if request.method == 'POST':
        form = formBrand(request.POST)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('/')

    passed = dict(
        form=form,
        MEDIA_URL  = settings.MEDIA_URL,
        STATIC_URL = settings.STATIC_URL)
    return render_to_response('generic_form_popup.html',
    passed, context_instance=RequestContext(request))

generic_form_popup.html
{% extends 'head-plain.html' %}
{% block title %}{% endblock %}
{% block headstuff %}{% endblock %}
{% block content %}   
<form action="{{ action }}" method="post">
{% csrf_token %}{{ form.as_p }}
<input type="submit" value="Submit" /> </form>    
{% endblock %}

A:

CreateView inherits from ModelFormMixin, which in turn inherits from FormMixin and SingleObjectMixin.
SingleObjectMixin provides the object template context variable, which is probably not going to be any use in the case of CreateView:

object: The object that this view is displaying. If context_object_name is specified, that variable will also be set in the context, with the same value as object.

But FormMixin provides the form context variable:

form: The form instance that was generated for the view.

Thus, you can refer to the documentation to display a form with a template:
<form action="/contact/" method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>

Which means that the very template you posted should almost work with the class based view:
{% extends 'head-plain.html' %}
{% block title %}{% endblock %}
{% block headstuff %}{% endblock %}
{% block content %}   
<form action="" method="post">
{% csrf_token %}{{ form.as_p }}
<input type="submit" value="Submit" /> </form>    
{% endblock %}

I removed {{ action }} because it is not part of the context, neither in the old-style view, neither with the class based view, so it doesn't make any sense. You should know that if action="" then the browser will submit to the current url. You can force the action to the current url with action="{{ request.path }}" or you can specify another url with the url template tag.
Suppose apply the best practice of naming url patterns, by changing:
(r'^brand_create2$',    BrandCreate.as_view()),

to:
(r'^brand_create2$',    BrandCreate.as_view(), name='band_create'),

Then you can use: action="{% url band_create %}".
You can also customize further:
<form action="/contact/" method="post">
    {% csrf_token %}
    {{ form.non_field_errors }}
    <div class="fieldWrapper">
        {{ form.subject.errors }}
        <label for="id_subject">Email subject:</label>
        {{ form.subject }}
    </div>
    <div class="fieldWrapper">
        {{ form.message.errors }}
        <label for="id_message">Your message:</label>
        {{ form.message }}
    </div>
    <div class="fieldWrapper">
        {{ form.sender.errors }}
        <label for="id_sender">Your email address:</label>
        {{ form.sender }}
    </div>
    <div class="fieldWrapper">
        {{ form.cc_myself.errors }}
        <label for="id_cc_myself">CC yourself?</label>
        {{ form.cc_myself }}
    </div>
    <p><input type="submit" value="Send message" /></p>
</form>

Of course, the fields available in the form depend on your Model.

