Skip to content

Instantly share code, notes, and snippets.

@jacobvalenta
Created January 30, 2014 20:55
Show Gist options
  • Save jacobvalenta/8718472 to your computer and use it in GitHub Desktop.
Save jacobvalenta/8718472 to your computer and use it in GitHub Desktop.
class CustomerSearchView(DatatableView):
template_name = "customers/search.html"
datatable_options = {
'columns': [
("Customer Number", 'number'),
("Name", ['first_name', 'last_name']),
"Address",
"Quick Menu",
"View Customer",
]
}
def get_column_Address_data(self, instance, *args, **kwargs):
pass
def get_column_Quick_Menu_data(self, instance, *args, **kwargs):
return '...'
def get_column_View_Customer_data(self, instance, *args, **kwargs):
return 'View Customer'
def get_queryset(self):
return Customer.objects.all()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment