Top "Django-class-based-views" questions

Django Class-based Views are Django views that are represented as classes.

django - AttributeError: 'NoneType' object has no attribute 'first_name'

Would appreciate some help understanding whenever I try to setup my client I am getting the following error: AttributeError: 'NoneType' …

python django django-models django-views django-class-based-views
How do I use UpdateView?

I have two, presumably related, problems with UpdateView. First, it is not updating the user but creating a new user …

django django-forms django-views django-class-based-views
how to alter/change the post data in django UpdateView

I am using django update view for my model/records editing stuff like below class EditProductView(LoginRequiredMixin, UpdateView): model = Product …

django post request django-class-based-views
Is it okay to set instance variables in a Django class based view?

I trying out Django's class based views (CBVs). class BlahView(TemplateView): template_name = 'blah/blah.html' def get_context_data(…

python django django-class-based-views
set initial value in CreateView from ForeignKey (non-self.request.user)

I am attempting to access ForeignKeys in Class Based Views CreateView. I would like to be able to dynamically set …

django django-templates foreign-keys django-class-based-views
Django. A good tutorial for Class Based Views

Is there any good tutorial for learn how to use Class Based Generics Views in Django? I think that the …

django django-class-based-views
Multiple Forms and Formsets in CreateView

I have 2 models, Father and Son. I have a page to register Father. On the same page I have a …

python django django-forms django-class-based-views
DetailView template not displaying model data

I have a model which I want to display as a Detail view, I have created a list view that …

django django-templates django-views django-class-based-views
No URL to redirect to. Either provide a url or define a get_absolute_url method on the Model

I am using CreateView to build a form. The CreateView is called from the DetailView. Once the form is submitted, …

python django forms python-3.x django-class-based-views
How do I set initial data on a Django class based generic createview with request data

I used Django's generic createview for my model from myproject.app.forms import PersonForm class PersonMixin(object): model = Person form_…

django django-forms django-generic-views django-class-based-views