Show Menu
Cheatography

Django Class Based Views Cheat Sheet by

Django Class Based Views

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)
           
 

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

          Cypressio Cheat Sheet
          Selenium WebDriver Cheat Sheet Cheat Sheet
          ISTQB Test Automation Engineering Cheat Sheet