This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This plugin hook for React table provides the ability for percentage | |
* widths to be provided in the column definitions, whilst maintaining the | |
* ability to resize those columns. | |
*/ | |
export const usePercentageColumns = hooks => { | |
hooks.useInstance.push(useInstance) | |
hooks.getRowProps.push(getRowStyles) | |
hooks.getHeaderProps.push(getHeaderProps) | |
hooks.getCellProps.push(getCellProps) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First go to https://secure.studentfinance.direct.gov.uk/ and log in. | |
// Now go to https://secure.studentfinance.direct.gov.uk/customer/payments/view?service=direct/1/Home/listPayments_TablePages.pages_linkPage&sp=AHome%2FlistPayments_TableView&sp=1 | |
// Now open the console and put in: | |
// | |
// var jq = document.createElement('script'); | |
// jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; | |
// document.getElementsByTagName('head')[0].appendChild(jq); | |
// jQuery.noConflict(); | |
// | |
// Press enter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ServiceResource(ModelResource): | |
manager = fields.ToOneField(UserResource, 'manager',full=True) | |
area = fields.ToOneField(AreaResource, 'area',full=True) | |
specification = fields.ToManyField('services.api.ServiceSpecResource','servicespec_set',full=True) | |
class Meta: | |
queryset = Service.objects.all() | |
resource_name = 'service' | |
class ServiceSpecResource(ModelResource): | |
service = fields.ToOneField(ServiceResource,'service') |