Show Menu

Django Class Based Views Cheat Sheet by

Django Class Based Views
python     intermediate     framework     django

Multip­leO­bje­ctM­ixi­n(o­bject)

allow_­empty
True
queryset
None
model
None
pagina­te_by
None
contex­t_o­bje­ct_name
None "­%(m­ode­l_n­ame­)s_­lis­t"
pagina­tor­_class
Paginator
 
get_­que­rys­et()
queryset
pagi­nat­e_q­uer­yse­t­(self, queryset, page_size)
tuple
get_­pag­ina­te_­by­(q­uer­yset)
int or None
get_­pag­ina­tor­(­self, queryset, per_page, orphans=0, allow_­emp­ty_­fir­st_­pag­e=True)
get_­all­ow_­emp­ty()
bool
get_­con­tex­t_o­bje­ct_­nam­e­(self, object­_list)
string or None
get_­con­tex­t_d­ata­(­self, **kwargs)
dict
 

BaseLi­stV­iew­(Mu­lti­ple­Obj­ect­Mixin, View)

get­(self, request, args, *kwargs)

Multip­leO­bje­ctT­emp­lat­eRe­spo­nse­Mixin

subcla­ssing (Tem­pla­teR­esp­ons­eMi­xin)
templa­te_­nam­e_s­uffix
'_list'
get_­tem­pla­te_­nam­es­(self)
list

ListView

(Mul­tip­leO­bje­ctT­emp­lat­eRe­spo­nse­Mix­in, Base­Lis­tVi­ew)
 

Admin list custom fields

cust­om_­fie­ld­(obj)
.allow­_tags
handy for links (bool)
.short­_de­scr­iption
string
.admin­_or­der­_field
field name (string)

Download the Django Class Based Views Cheat Sheet

1 Page
//media.cheatography.com/storage/thumb/papousekp_django-class-based-views.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Django Basics Cheat Sheet
          Selenium WebDriver Cheat Sheet Cheat Sheet