Jul 252009

class Meta:
order = ['name']
——-
class Meta:
ordering=['-pub_date']
——-
class Meta:
ordering=['+pub_date']
——-
Django will retrieve list of objects in order, by name, descending or ascending pub_date etc.

Posted by weboom at 2:48 pm Tagged with: ,
Jul 252009

Class Meta
is an inner class which can specify a number of common options.
——
e.g.,
Class Meta:
ordering = ['name']
verbose_name_plura = “Categories”
———–

Posted by weboom at 1:40 pm Tagged with: ,
Switch to our mobile site
Top Footer