Building a datagrid is too verbose and we're repeating data that it
has been already set in the models. So could use those metadata.

class TableDataGrid(grids.DataGrid):
   model = models.Table
   meta = model._meta
   fields = [ for field in meta._fields()]

   # ### This faills. But the idea is to execute dinamically all
   data = {}
   for field in meta._fields():
      name =
      if 'id' in name:
         name = 'pk'
      data[name] = "grids.Column(%s)" % unicode(field.verbose_name)
   # ###

   def __init__(self, request):
      grids.DataGrid.__init__(self, request, self.model.objects.all(),
      self.default_sort = self.meta.ordering
      self.default_columns = self.fields

To working with metada:

Thanks for this application. It should be in django.contribs because
there are many people that needs anything so (and it's more powerfull
than databrowse).

You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to