Ejemplo n.º 1
0
 def _composites(self, request, *args, **kwargs):
     yield ObjectTools(parent=self)
     # FIXME: ChangeList depends on filter to work
     filter = Filter(parent=self, list_filter=self.list_filter, model_class=self.model_class)
     # filter is used before it has been init for this request
     # it expects request to be available
     filter.request = self.request
     change_list = AdminChangeList(parent=self, filter=filter, model_class=self.model_class, list_display=self.list_display)
     yield change_list
     yield filter
Ejemplo n.º 2
0
 def _composites(self, request, *args, **kwargs):
     options = dict(
         list_filter=self.list_filter,
         model_class=Favorite,
         parent=self,
     )
     filter = Filter(**options)
     # filter is used before it has been init for this request
     # and it expects request to be available
     filter.request = self.request
     options = dict(
         queryset=self._queryset(request),
         model_class=Favorite,
         filter=filter,
         parent=self,
         list_display=self.list_display,
     )
     table = SortableTable(**options)
     yield table
     yield filter