From b0b7fc42b95c23ac7e2f22919825b3d17dd3b3c9 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 6 Mar 2019 18:24:00 -0600 Subject: [PATCH] Add views for CORE-POS members --- rattail_demo/web/menus.py | 10 +++++ rattail_demo/web/views/corepos/__init__.py | 1 + rattail_demo/web/views/corepos/members.py | 49 ++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 rattail_demo/web/views/corepos/members.py diff --git a/rattail_demo/web/menus.py b/rattail_demo/web/menus.py index 37a818a..48777fa 100644 --- a/rattail_demo/web/menus.py +++ b/rattail_demo/web/menus.py @@ -127,6 +127,16 @@ def simple_menus(request): 'url': url('corepos.customers'), 'perm': 'corepos.customers.list', }, + { + 'title': "Member Types", + 'url': url('corepos.member_types'), + 'perm': 'corepos.member_types.list', + }, + { + 'title': "Members", + 'url': url('corepos.members'), + 'perm': 'corepos.members.list', + }, { 'title': "Employees", 'url': url('corepos.employees'), diff --git a/rattail_demo/web/views/corepos/__init__.py b/rattail_demo/web/views/corepos/__init__.py index 07f319c..2c9f45b 100644 --- a/rattail_demo/web/views/corepos/__init__.py +++ b/rattail_demo/web/views/corepos/__init__.py @@ -13,6 +13,7 @@ def includeme(config): config.include('rattail_demo.web.views.corepos.subdepartments') config.include('rattail_demo.web.views.corepos.vendors') config.include('rattail_demo.web.views.corepos.products') + config.include('rattail_demo.web.views.corepos.members') config.include('rattail_demo.web.views.corepos.customers') config.include('rattail_demo.web.views.corepos.employees') config.include('rattail_demo.web.views.corepos.transactions') diff --git a/rattail_demo/web/views/corepos/members.py b/rattail_demo/web/views/corepos/members.py new file mode 100644 index 0000000..bb7debc --- /dev/null +++ b/rattail_demo/web/views/corepos/members.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8; -*- +""" +CORE-POS member views +""" + +from __future__ import unicode_literals, absolute_import + +from corepos.db import model as corepos + +from .master import CoreMasterView + + +class MemberTypeView(CoreMasterView): + """ + Master view for member types + """ + model_class = corepos.MemberType + model_title = "CORE-POS Member Type" + url_prefix = '/core-pos/member-types' + route_prefix = 'corepos.member_types' + + labels = { + 'memtype': "Type", + 'memDesc': "Description", + 'custdataType': "Cust. Data Type", + 'ssi': "SSI", + 'salesCode': "Sales Code", + } + + def configure_grid(self, g): + super(MemberTypeView, self).configure_grid(g) + + g.set_link('memtype') + g.set_link('memDesc') + + +class MemberView(CoreMasterView): + """ + Master view for members + """ + model_class = corepos.MemberInfo + model_title = "CORE-POS Member" + url_prefix = '/core-pos/members' + route_prefix = 'corepos.members' + + +def includeme(config): + MemberTypeView.defaults(config) + MemberView.defaults(config)