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_qu­eryset()
queryset
pagina­te_­que­ryset(self, queryset, page_size)
tuple
get_pa­gin­ate_by(queryset)
int or None
get_pa­ginator(self, queryset, per_page, orphans=0, allow_­emp­ty_­fir­st_­pag­e=True)
get_al­low­_empty()
bool
get_co­nte­xt_­obj­ect­_name(self, object­_list)
string or None
get_co­nte­xt_data(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 (Templa­teR­esp­ons­eMixin)
templa­te_­nam­e_s­uffix
'_list'
get_te­mpl­ate­_names(self)
list

ListView

(Multip­leO­bje­ctT­emp­lat­eRe­spo­nse­Mixin, BaseLi­stView)
 

Admin list custom fields

custom­_field(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

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