diff --git a/tailbone_corepos/views/corepos/members.py b/tailbone_corepos/views/corepos/members.py index c46aeb9..6e485cb 100644 --- a/tailbone_corepos/views/corepos/members.py +++ b/tailbone_corepos/views/corepos/members.py @@ -95,6 +95,7 @@ class MemberView(CoreOfficeMasterView): 'email2', 'ads_ok', 'dates', + 'barcodes', ] def configure_grid(self, g): @@ -111,6 +112,8 @@ class MemberView(CoreOfficeMasterView): f.set_renderer('dates', self.render_member_dates) + f.set_renderer('barcodes', self.render_barcodes) + f.append('customers') f.set_readonly('customers') f.set_renderer('customers', self.render_customers) @@ -124,6 +127,22 @@ class MemberView(CoreOfficeMasterView): items.append(HTML.tag('li', c=str(dates))) return HTML.tag('ul', c=items) + def render_barcodes(self, member, field): + barcodes = member.barcodes + if not barcodes: + return + + items = [] + for barcode in barcodes: + if barcode.upc: + text = barcode.upc + elif barcode.upc is None: + text = "(null)" + else: + text = "(empty string)" + items.append(HTML.tag('li', c=[text])) + return HTML.tag('ul', c=items) + def render_customers(self, member, field): customers = member.customers if not customers: