Commit 14db3188 authored by Jérome Perrin's avatar Jérome Perrin

Simplify class and property sheet hierarchy for coordinates

Coordinate base class already inherit from Base, so no need for class
inheriting from Coordinate to inherit from Base again. Also, no need to reapeat
the property sheets that are already defined on Coordinate.
parent 5e6a9e24
......@@ -52,9 +52,7 @@ class BankAccount(Node, Coordinate):
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.SimpleItem
, PropertySheet.CategoryCore
property_sheets = ( PropertySheet.CategoryCore
, PropertySheet.Task
, PropertySheet.Resource
, PropertySheet.Reference
......
......@@ -29,14 +29,13 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Base import Base
from Products.ERP5Type.Utils import deprecated
from Products.ERP5.Document.Coordinate import Coordinate
import string
class GeographicAddress(Coordinate, Base):
class GeographicAddress(Coordinate):
"""
A geographic address holds a complete set of
geographic coordinates including street, number,
......@@ -44,9 +43,6 @@ class GeographicAddress(Coordinate, Base):
Geographic address is a terminating leaf
in the OFS. It can not contain anything.
Geographic address inherits from Base and
from the mix-in Coordinate
"""
meta_type = 'ERP5 Geographic Address'
portal_type = 'Address'
......@@ -57,11 +53,8 @@ class GeographicAddress(Coordinate, Base):
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.SimpleItem
, PropertySheet.SortIndex
property_sheets = ( PropertySheet.SortIndex
, PropertySheet.CategoryCore
, PropertySheet.Coordinate
, PropertySheet.GeographicAddress
)
......
......@@ -29,13 +29,12 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Base import Base
from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.Utils import deprecated
from Products.ERP5.Document.Coordinate import Coordinate
class InternetProtocolAddress(Base, Coordinate):
class InternetProtocolAddress(Coordinate):
"""
A internet protocol address holds a address of
a computer on computer network using TCP/IP.
......@@ -49,10 +48,7 @@ class InternetProtocolAddress(Base, Coordinate):
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.SimpleItem
, PropertySheet.CategoryCore
, PropertySheet.Coordinate
property_sheets = ( PropertySheet.CategoryCore
, PropertySheet.InternetProtocolAddress
)
......
......@@ -29,13 +29,12 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Base import Base
from Products.ERP5Type.Utils import deprecated
from Products.ERP5.Document.Coordinate import Coordinate
import re
class Telephone(Coordinate, Base):
class Telephone(Coordinate):
"""
A telephone is a coordinate which stores a telephone number
The telephone class may be used by multiple content types (ex. Fax,
......@@ -44,9 +43,6 @@ class Telephone(Coordinate, Base):
A telephone is a terminating leaf
in the OFS. It can not contain anything.
Telephone inherits from Base and
from the mix-in Coordinate
A list of I18N telephone codes can be found here::
http://kropla.com/dialcode.htm
"""
......@@ -60,11 +56,8 @@ class Telephone(Coordinate, Base):
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.SimpleItem
, PropertySheet.CategoryCore
property_sheets = ( PropertySheet.CategoryCore
, PropertySheet.SortIndex
, PropertySheet.Coordinate
, PropertySheet.Telephone
)
# This is a list of regex.
......
......@@ -30,7 +30,6 @@
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Base import Base
from Products.ERP5Type.Utils import deprecated
from Products.ERP5.Document.Coordinate import Coordinate
from Products.ERP5.mixin.url import UrlMixin, no_crawl_protocol_list,\
......@@ -39,7 +38,7 @@ from zLOG import LOG
_marker = object()
class Url(Coordinate, Base, UrlMixin):
class Url(Coordinate, UrlMixin):
"""
A Url is allows to represent in a standard way coordinates
such as web sites, emails, ftp sites, etc.
......@@ -54,10 +53,7 @@ class Url(Coordinate, Base, UrlMixin):
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Default Properties
property_sheets = ( PropertySheet.Base
, PropertySheet.SimpleItem
, PropertySheet.Coordinate
, PropertySheet.Url
property_sheets = ( PropertySheet.Url
, PropertySheet.SortIndex
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment