-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfreightcompanycreator.py
47 lines (37 loc) · 1.65 KB
/
freightcompanycreator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
###########################################################################
# Copyright (C) 2003 by kosh
#
# Copyright: See COPYING file that comes with this distribution
#
###########################################################################
#For Security control and init
from AccessControl import ClassSecurityInfo
import Globals
from userobject import UserObject
class FreightCompanyCreator(UserObject):
"Provide a list of freight companys and freight classes that are FreightCompanyContainer can subscribe to to create what it needs"
security = ClassSecurityInfo()
meta_type = "FreightCompanyCreator"
security.declareProtected('View management screens', 'edit')
def edit(self, *args, **kw):
"Inline edit short object"
temp = []
temp.append('<p>Freight Companies</p>')
temp.append(self.freightCompanies.edit())
temp.append('<p>Freight Classes</p>')
temp.append(self.freightClasses.edit())
return ''.join(temp)
security.declarePrivate('instance')
instance = (('freightCompanies', ('create', 'ListText')),('freightClasses',('create', 'ListText')))
security.declarePrivate('getFreightCompanies')
def getFreightCompanies(self):
"return the freight companies that we have"
return self.freightCompanies.getAvailableListsContents()
security.declarePrivate('getFreightClasses')
def getFreightClasses(self):
"return the freight classes that we have"
return self.freightClasses.getAvailableListsContents()
Globals.InitializeClass(FreightCompanyCreator)
import register
register.registerClass(FreightCompanyCreator)